Browse Source

refs: plug strbuf leak in lock_ref_sha1_basic()

Don't just reset, but release the resource held by the local
variable that is about to go out of scope.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
René Scharfe 10 years ago committed by Junio C Hamano
parent
commit
33adc83ddb
  1. 2
      refs.c

2
refs.c

@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname, @@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
struct strbuf err = STRBUF_INIT;
unable_to_lock_message(ref_file, errno, &err);
error("%s", err.buf);
strbuf_reset(&err);
strbuf_release(&err);
goto error_return;
}
}

Loading…
Cancel
Save