X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fdump.c;h=9c013665c61c2aeaf4e19ecf05ba1d111e97c428;hb=50dc64a7af3664ca55ac74b393459a6d54e6958f;hp=42eb256073a73b4eee20504d6e49ca3cc0bf0de7;hpb=f8d0e01e46cd9452b5d7780906029d899215cb89;p=jansson.git diff --git a/src/dump.c b/src/dump.c index 42eb256..9c01366 100644 --- a/src/dump.c +++ b/src/dump.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Petri Lehtinen + * Copyright (c) 2009-2011 Petri Lehtinen * * Jansson is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. @@ -313,7 +313,7 @@ static int do_dump(const json_t *json, size_t flags, int depth, int (*cmp_func)(const void *, const void *); size = json_object_size(json); - keys = malloc(size * sizeof(object_key_t *)); + keys = jsonp_malloc(size * sizeof(object_key_t *)); if(!keys) goto object_error; @@ -346,7 +346,7 @@ static int do_dump(const json_t *json, size_t flags, int depth, if(dump(separator, separator_length, data) || do_dump(value, flags, depth + 1, dump, data)) { - free(keys); + jsonp_free(keys); goto object_error; } @@ -355,7 +355,7 @@ static int do_dump(const json_t *json, size_t flags, int depth, if(dump(",", 1, data) || dump_indent(flags, depth + 1, 1, dump, data)) { - free(keys); + jsonp_free(keys); goto object_error; } } @@ -363,13 +363,13 @@ static int do_dump(const json_t *json, size_t flags, int depth, { if(dump_indent(flags, depth, 0, dump, data)) { - free(keys); + jsonp_free(keys); goto object_error; } } } - free(keys); + jsonp_free(keys); } else { @@ -432,7 +432,7 @@ char *json_dumps(const json_t *json, size_t flags) return NULL; } - result = strdup(strbuffer_value(&strbuff)); + result = jsonp_strdup(strbuffer_value(&strbuff)); strbuffer_close(&strbuff); return result;