Skip to content

Commit

Permalink
merge-recursive: fix memleaks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Mar 23, 2015
1 parent d687839 commit 473091e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 473091e

Please sign in to comment.