From 473091e21ef2dbee6087cdf0429858faf2b50740 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Fri, 20 Mar 2015 17:28:04 -0700 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- merge-recursive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/merge-recursive.c b/merge-recursive.c index 771f5e21b0..1c9c30db6c 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1858,6 +1858,9 @@ int merge_trees(struct merge_options *o, string_list_clear(re_head, 0); string_list_clear(entries, 1); + free(re_merge); + free(re_head); + free(entries); } else clean = 1;