mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Free zstring when switching to preset value
This is only applicable for bounded cvars (MIN, MAX), since otherwise there's no way to allocate a zstring.
This commit is contained in:
parent
d18fc8882f
commit
85914cc7cd
1 changed files with 4 additions and 0 deletions
|
@ -1441,6 +1441,10 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
|||
return;
|
||||
}
|
||||
|
||||
// free the old value string
|
||||
Z_Free(var->zstring);
|
||||
var->zstring = NULL;
|
||||
|
||||
var->value = var->PossibleValue[i].value;
|
||||
var->string = var->PossibleValue[i].strvalue;
|
||||
goto finish;
|
||||
|
|
Loading…
Reference in a new issue