Fix a potential crash with the cvar reset command.

This commit is contained in:
Bill Currie 2011-09-07 21:07:52 +09:00
parent 2ae33a753a
commit e8e8dad535

View file

@ -697,6 +697,8 @@ Cvar_Get (const char *name, const char *string, int cvarflags,
|| strequal (var->description, USER_RO_CVAR)
|| strequal (var->description, USER_CVAR))
var->description = description;
if (!var->default_string)
var->default_string = strdup (string);
}
if (var->callback)
var->callback (var);