diff options
author | Petri Lehtinen <petri@digip.org> | 2010-01-10 21:01:07 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2010-01-10 21:01:07 +0200 |
commit | 93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c (patch) | |
tree | e1e382728cbb8433324101d0761952efb21ce1b5 /src | |
parent | b21f07b35c7cbf80a2275fde97b65b270119d9a1 (diff) | |
download | jansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.zip jansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.tar.gz jansson-93ac06c902cd9518fc467c1e40c6bd46c4ee0d0c.tar.bz2 |
Fix memory leaks in json_*_deep_copy()
Diffstat (limited to 'src')
-rw-r--r-- | src/value.c | 4 |
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; } |