mirror of
https://github.com/DaveGamble/cJSON.git
synced 2024-12-25 20:30:50 +08:00
fix: potential memory leak in merge_patch() (#611)
This commit is contained in:
parent
d348621ca9
commit
f50dafc7d0
@ -1367,6 +1367,7 @@ static cJSON *merge_patch(cJSON *target, const cJSON * const patch, const cJSON_
|
|||||||
replacement = merge_patch(replace_me, patch_child, case_sensitive);
|
replacement = merge_patch(replace_me, patch_child, case_sensitive);
|
||||||
if (replacement == NULL)
|
if (replacement == NULL)
|
||||||
{
|
{
|
||||||
|
cJSON_Delete(target);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user