提交 33adc83d 编写于 作者: R René Scharfe 提交者: Junio C Hamano

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: NRene Scharfe <l.s.r@web.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 bbcefffc
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册