OSDN Git Service

merge-recursive: fix memleaks
authorStefan Beller <sbeller@google.com>
Sat, 21 Mar 2015 00:28:04 +0000 (17:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 23 Mar 2015 18:12:58 +0000 (11:12 -0700)
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 <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c

index 771f5e2..1c9c30d 100644 (file)
@@ -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;