From 20fbfd869fe8faae0ce4573b60b540024db7385d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 10 Sep 2007 00:14:38 -0700 Subject: [PATCH] archive - leakfix for format_subst() Signed-off-by: Junio C Hamano --- builtin-archive.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.30.2