summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Rene Scharfe <l.s.r@web.de>2017-08-30 19:58:12 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-09-07 08:49:28 +0900
commitaeb014f6aecab6c72490dbe00fd9518b2c75db11 (patch)
tree48ac32c84a2234335651e436e5c2c2ba283c40e1
parentnotes: release strbuf after use in notes_copy_from_stdin() (diff)
downloadtgif-aeb014f6aecab6c72490dbe00fd9518b2c75db11.tar.xz
refs: release strbuf on error return in write_pseudoref()
Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index b0106b8162..d8dc86b1f5 100644
--- a/refs.c
+++ b/refs.c
@@ -612,7 +612,7 @@ static int write_pseudoref(const char *pseudoref, const unsigned char *sha1,
if (fd < 0) {
strbuf_addf(err, "could not open '%s' for writing: %s",
filename, strerror(errno));
- return -1;
+ goto done;
}
if (old_sha1) {