Skip to content

Commit 473091e

Browse files
stefanbellergitster
authored andcommitted
merge-recursive: fix memleaks
These string_list instances were allocated by get_renames() and get_unmerged for the sole use of this caller, and the function is responsible for freeing them, not just their contents. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d687839 commit 473091e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

merge-recursive.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,9 @@ int merge_trees(struct merge_options *o,
18581858
string_list_clear(re_head, 0);
18591859
string_list_clear(entries, 1);
18601860

1861+
free(re_merge);
1862+
free(re_head);
1863+
free(entries);
18611864
}
18621865
else
18631866
clean = 1;

0 commit comments

Comments
 (0)