From: René Scharfe Date: Wed, 24 Dec 2014 00:18:45 +0000 (+0100) Subject: refs: plug strbuf leak in lock_ref_sha1_basic() X-Git-Tag: v2.3.0-rc0~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33adc83ddb315a614a59604a0d39caa5a1b27bdd;p=thirdparty%2Fgit.git refs: plug strbuf leak in lock_ref_sha1_basic() Don't just reset, but release the resource held by the local variable that is about to go out of scope. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 5fcacc6c41..ed3b2cb405 100644 --- a/refs.c +++ b/refs.c @@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, struct strbuf err = STRBUF_INIT; unable_to_lock_message(ref_file, errno, &err); error("%s", err.buf); - strbuf_reset(&err); + strbuf_release(&err); goto error_return; } }