1
0
mirror of https://github.com/git/git.git synced 2024-09-28 19:42:15 +02:00

dir-iterator: release strbuf after use

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2019-08-07 13:15:14 +02:00 committed by Junio C Hamano
parent c4d9c506f7
commit 9b7b0295f9

@ -2151,8 +2151,10 @@ static struct ref_iterator *reflog_iterator_begin(struct ref_store *ref_store,
strbuf_addf(&sb, "%s/logs", gitdir);
diter = dir_iterator_begin(sb.buf, 0);
if(!diter)
if (!diter) {
strbuf_release(&sb);
return empty_ref_iterator_begin();
}
iter = xcalloc(1, sizeof(*iter));
ref_iterator = &iter->base;