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>
This commit is contained in:
Rene Scharfe 2017-08-30 19:58:12 +02:00 committed by Junio C Hamano
parent 1f3992f4be
commit aeb014f6ae

2
refs.c
View File

@ -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) {