aboutsummaryrefslogtreecommitdiff
path: root/src/value.c
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2010-01-10 21:01:07 +0200
committerPetri Lehtinen <petri@digip.org>2010-01-10 21:01:07 +0200
commit93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c (patch)
treee1e382728cbb8433324101d0761952efb21ce1b5 /src/value.c
parentb21f07b35c7cbf80a2275fde97b65b270119d9a1 (diff)
downloadjansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.zip
jansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.tar.gz
jansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.tar.bz2
Fix memory leaks in json_*_deep_copy()
Diffstat (limited to 'src/value.c')
-rw-r--r--src/value.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/value.c b/src/value.c
index e118af1..01e180e 100644
--- a/src/value.c
+++ b/src/value.c
@@ -285,7 +285,7 @@ static json_t *json_object_deep_copy(json_t *object)
key = json_object_iter_key(iter);
value = json_object_iter_value(iter);
- json_object_set_nocheck(result, key, json_deep_copy(value));
+ json_object_set_new_nocheck(result, key, json_deep_copy(value));
iter = json_object_iter_next(object, iter);
}
@@ -586,7 +586,7 @@ static json_t *json_array_deep_copy(json_t *array)
return NULL;
for(i = 0; i < json_array_size(array); i++)
- json_array_append(result, json_deep_copy(json_array_get(array, i)));
+ json_array_append_new(result, json_deep_copy(json_array_get(array, i)));
return result;
}