diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 8fe4ff0..b39e432 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -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);