diff --git a/cJSON_Utils.c b/cJSON_Utils.c index f4ad32a..8e70e00 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -1406,6 +1406,10 @@ static cJSON *generate_merge_patch(cJSON * const from, cJSON * const to, const c from_child = from->child; to_child = to->child; patch = cJSON_CreateObject(); + if (patch == NULL) + { + return NULL; + } while (from_child || to_child) { int diff;