mirror of
https://github.com/DaveGamble/cJSON.git
synced 2024-12-27 14:14:07 +08:00
fix memory leak mentioned in issue 414
This commit is contained in:
parent
95368da1a1
commit
500a9db81b
@ -216,6 +216,7 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje
|
|||||||
if (child_index > ULONG_MAX)
|
if (child_index > ULONG_MAX)
|
||||||
{
|
{
|
||||||
cJSON_free(target_pointer);
|
cJSON_free(target_pointer);
|
||||||
|
cJSON_free(full_pointer);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
sprintf((char*)full_pointer, "/%lu%s", (unsigned long)child_index, target_pointer); /* /<array_index><path> */
|
sprintf((char*)full_pointer, "/%lu%s", (unsigned long)child_index, target_pointer); /* /<array_index><path> */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user