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:
parent
1f3992f4be
commit
aeb014f6ae
2
refs.c
2
refs.c
@ -612,7 +612,7 @@ static int write_pseudoref(const char *pseudoref, const unsigned char *sha1,
|
|||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
strbuf_addf(err, "could not open '%s' for writing: %s",
|
strbuf_addf(err, "could not open '%s' for writing: %s",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return -1;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_sha1) {
|
if (old_sha1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user