Avoid potential memory corruption

This commit is contained in:
Pierre Pronchery 2016-09-15 14:02:05 +02:00
parent 5f051980de
commit 98ac3ecd15

View File

@ -71,6 +71,7 @@ Variable * variable_new(VariableType type, void const * value)
if((variable = object_new(sizeof(*variable))) == NULL) if((variable = object_new(sizeof(*variable))) == NULL)
return NULL; return NULL;
variable->type = VT_NULL;
if(variable_set_from(variable, type, value) != 0) if(variable_set_from(variable, type, value) != 0)
{ {
object_delete(variable); object_delete(variable);