[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).
This commit is contained in:
Bill Currie 2020-03-31 20:38:41 +09:00
parent e2d1a0f7d2
commit 58acc483fd

View file

@ -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;