json_object_iter_set_new: Fix error branch leak.
This function needs to release a reference to value if the other arguments are invalid. Issue #135
This commit is contained in:
parent
9a1d9c88fc
commit
89dad8959b
@ -258,7 +258,10 @@ json_t *json_object_iter_value(void *iter)
|
||||
int json_object_iter_set_new(json_t *json, void *iter, json_t *value)
|
||||
{
|
||||
if(!json_is_object(json) || !iter || !value)
|
||||
{
|
||||
json_decref(value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
hashtable_iter_set(iter, value);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user