summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-12-24 01:18:45 +0100
committerJunio C Hamano <gitster@pobox.com>2014-12-29 13:14:16 -0800
commit33adc83ddb315a614a59604a0d39caa5a1b27bdd (patch)
treeea58c4fa8f2fd59f3da8ab2944be3c7a91e30728 /refs.c
parentbbcefffcea9789e4a1a2023a1c778e2c07db77a7 (diff)
downloadgit-33adc83ddb315a614a59604a0d39caa5a1b27bdd.tar.gz
refs: plug strbuf leak in lock_ref_sha1_basic()rs/plug-strbuf-leak-in-lock-ref
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>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
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;
}
}