From 58acc483fdf69f9f8b2c86b7c8b8fde24fa0ed44 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 31 Mar 2020 20:38:41 +0900 Subject: [PATCH] [gamecode] Save new string ref in return slot This plugs the memory leak that caused qwaq to crash after resizing the locals window a "few" times (several seconds of playing with the size). --- libs/gamecode/pr_strings.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gamecode/pr_strings.c b/libs/gamecode/pr_strings.c index 194dbc05c..7781865a7 100644 --- a/libs/gamecode/pr_strings.c +++ b/libs/gamecode/pr_strings.c @@ -468,6 +468,7 @@ PR_SetReturnString (progs_t *pr, const char *s) pr_strfree (pr, sr->s.string); } else { sr = new_string_ref (res); + res->rs_slot->strref = sr; } sr->type = str_return; sr->rs_slot = res->rs_slot;