projects
/
jansson.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b21f07b
)
Fix memory leaks in json_*_deep_copy()
author
Petri Lehtinen
<petri@digip.org>
Sun, 10 Jan 2010 19:01:07 +0000
(21:01 +0200)
committer
Petri Lehtinen
<petri@digip.org>
Sun, 10 Jan 2010 19:01:07 +0000
(21:01 +0200)
src/value.c
patch
|
blob
|
history
diff --git
a/src/value.c
b/src/value.c
index
e118af1
..
01e180e
100644
(file)
--- 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);
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_n
ew_n
ocheck(result, key, json_deep_copy(value));
iter = json_object_iter_next(object, iter);
}
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++)
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;
}
return result;
}