mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-10-15 10:29:51 +00:00
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:
1 parent
56b819bfbc
commit
68cd0d4a11
11 files changed
+138
-133
No files matched your search
+2
-2
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user