mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
fix a possible dereference of null pointer
This commit is contained in:
parent
488169faca
commit
9bf4960cd5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user