mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-09 00:12:56 +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
eeb208312a
commit
2ba1417b9e
1 changed files with 4 additions and 0 deletions
|
|
@ -1393,6 +1393,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…
Add table
Reference in a new issue