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 <gitster@pobox.com>
Junio C Hamano committed
Apr 17, 2017 at 21:56 UTC
372b050b6bd4bd3256e6fa21ab0fef47dd768d98
1 file changed
+1
builtin/replace.c
+1
@@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
120
if (fn(full_hex, ref.buf, &oid))
121
had_error = 1;
122
}
123
+ strbuf_release(&ref);
124
return had_error;
125
}
126