From: Junio C Hamano Date: Mon, 10 Sep 2007 07:14:38 +0000 (-0700) Subject: archive - leakfix for format_subst() X-Git-Tag: v1.5.4-rc0~451^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=20fbfd869fe8faae0ce4573b60b540024db7385d;p=git.git archive - leakfix for format_subst() Signed-off-by: Junio C Hamano --- diff --git a/builtin-archive.c b/builtin-archive.c index e221f115f..a90c65ce5 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -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);