diff options
author | René Scharfe <l.s.r@web.de> | 2019-08-07 13:15:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-07 12:25:35 -0700 |
commit | 9b7b0295f9521262b50143e580f4eb27b7bb83a7 (patch) | |
tree | 205b8e5d0e40aede12050c2974803cd59d00f49e /refs | |
parent | clone: replace strcmp by fspathcmp (diff) | |
download | tgif-9b7b0295f9521262b50143e580f4eb27b7bb83a7.tar.xz |
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>
Diffstat (limited to 'refs')
-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; |