cJSON.c: Pass allocation functions through internal functions

This is the first step in removing the global allocator functions. Every
internal function now only accesses its locally available set of
allocators.
This commit is contained in:
Max Bruckner committed 2017-02-21 14:50:49 +01:00
1 parent 56b819bfbc
commit 68cd0d4a11
11 files changed
+138 -133

No files matched your search

+2 -2
View File
@@ -30,11 +30,11 @@ extern void reset(cJSON *item)
}
if ((item->valuestring != NULL) && !(item->type & cJSON_IsReference))
{
cJSON_free(item->valuestring);
global_hooks.deallocate(item->valuestring);
}
if ((item->string != NULL) && !(item->type & cJSON_StringIsConst))
{
cJSON_free(item->string);
global_hooks.deallocate(item->string);
}
memset(item, 0, sizeof(cJSON));