Skip to content

Commit

Permalink
archive - leakfix for format_subst()
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Sep 10, 2007
1 parent 3d59405 commit 20fbfd8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static void *format_subst(const struct commit *commit, const char *format,

formatted_len = format_commit_message(commit, fmt, &formatted,
&allocated);
free(fmt);
result = xrealloc(result, result_len + a_len + formatted_len);
memcpy(result + result_len, a, a_len);
memcpy(result + result_len + a_len, formatted, formatted_len);
Expand Down

0 comments on commit 20fbfd8

Please sign in to comment.