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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe committed
Dec 24, 2014 at 01:18 UTC
33adc83ddb315a614a59604a0d39caa5a1b27bdd
1 file changed
+1
-1
refs.c
+1
-1
@@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
2334
struct strbuf err = STRBUF_INIT;
2335
unable_to_lock_message(ref_file, errno, &err);
2336
error("%s", err.buf);
2337
- strbuf_reset(&err);
2337
+ strbuf_release(&err);
2338
goto error_return;
2339
}
2340
}