mirror of https://github.com/DaveGamble/cJSON
cJSON_Utils: Fix potential null pointer dereference
Found by coverity
This commit is contained in:
parent
2683d4d987
commit
795c3acabe
|
@ -468,7 +468,7 @@ static int cJSONUtils_ApplyPatch(cJSON *object, cJSON *patch)
|
||||||
cJSONUtils_InplaceDecodePointerString(childptr);
|
cJSONUtils_InplaceDecodePointerString(childptr);
|
||||||
|
|
||||||
/* add, remove, replace, move, copy, test. */
|
/* add, remove, replace, move, copy, test. */
|
||||||
if (!parent)
|
if ((parent == NULL) || (childptr == NULL))
|
||||||
{
|
{
|
||||||
/* Couldn't find object to add to. */
|
/* Couldn't find object to add to. */
|
||||||
free(parentptr);
|
free(parentptr);
|
||||||
|
|
Loading…
Reference in New Issue