mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03: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:
@@ -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