aboutsummaryrefslogtreecommitdiff
path: root/src/value.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/value.c')
-rw-r--r--src/value.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/value.c b/src/value.c
index 86fda0a..94869f4 100644
--- a/src/value.c
+++ b/src/value.c
@@ -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;