Skip to content

Commit f50dafc

Browse files
author
Alan Wang
authored
fix: potential memory leak in merge_patch() (DaveGamble#611)
1 parent d348621 commit f50dafc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cJSON_Utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ static cJSON *merge_patch(cJSON *target, const cJSON * const patch, const cJSON_
13671367
replacement = merge_patch(replace_me, patch_child, case_sensitive);
13681368
if (replacement == NULL)
13691369
{
1370+
cJSON_Delete(target);
13701371
return NULL;
13711372
}
13721373

0 commit comments

Comments
 (0)