Fix a use after free

This commit is contained in:
Petri Lehtinen 2015-02-07 07:36:29 +02:00
parent 8b1bdcacb7
commit 11813f4128

View File

@ -240,10 +240,10 @@ static json_t *pack_object(scanner_t *s, va_list *ap)
} }
if(json_object_set_new_nocheck(object, key, value)) { if(json_object_set_new_nocheck(object, key, value)) {
set_error(s, "<internal>", "Unable to add key \"%s\"", key);
if(ours) if(ours)
jsonp_free(key); jsonp_free(key);
set_error(s, "<internal>", "Unable to add key \"%s\"", key);
goto error; goto error;
} }