archive - leakfix for format_subst()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2007-09-10 00:14:38 -07:00
parent 3d59405ced
commit 20fbfd869f

View File

@ -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);