From: Rene Scharfe Date: Wed, 30 Aug 2017 17:58:12 +0000 (+0200) Subject: refs: release strbuf on error return in write_pseudoref() X-Git-Tag: v2.15.0-rc0~78^2~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/aeb014f6aecab6c72490dbe00fd9518b2c75db11?ds=sidebyside refs: release strbuf on error return in write_pseudoref() Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- 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) {