From: Junio C Hamano Date: Tue, 18 Apr 2017 04:56:54 +0000 (-0700) Subject: replace: plug a memory leak X-Git-Tag: v2.13.0-rc1~21^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=372b050b6bd4bd3256e6fa21ab0fef47dd768d98;p=thirdparty%2Fgit.git replace: plug a memory leak Recent update to for_each_replace_name() to make it use a strbuf in place of a fixed buffer forgot to release the memory held by the strbuf before leaving the function. Signed-off-by: Junio C Hamano --- diff --git a/builtin/replace.c b/builtin/replace.c index 065515baba..ab17668f43 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn) if (fn(full_hex, ref.buf, &oid)) had_error = 1; } + strbuf_release(&ref); return had_error; }