From aeb014f6aecab6c72490dbe00fd9518b2c75db11 Mon Sep 17 00:00:00 2001 From: Rene Scharfe Date: Wed, 30 Aug 2017 19:58:12 +0200 Subject: [PATCH] refs: release strbuf on error return in write_pseudoref() Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {