diff options
-rw-r--r-- | refs/files-backend.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index b1f8f53a09..d60767ab73 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -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; |