mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-07-27 21:27:50 +00:00
cJSON_Utils: Fix potential null pointer dereference
Found by coverity
This commit is contained in:
+1
-1
@@ -468,7 +468,7 @@ static int cJSONUtils_ApplyPatch(cJSON *object, cJSON *patch)
|
||||
cJSONUtils_InplaceDecodePointerString(childptr);
|
||||
|
||||
/* add, remove, replace, move, copy, test. */
|
||||
if (!parent)
|
||||
if ((parent == NULL) || (childptr == NULL))
|
||||
{
|
||||
/* Couldn't find object to add to. */
|
||||
free(parentptr);
|
||||
|
||||
Reference in New Issue
Block a user