summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-08-07 11:15:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-07 19:25:35 (GMT)
commit9b7b0295f9521262b50143e580f4eb27b7bb83a7 (patch)
tree205b8e5d0e40aede12050c2974803cd59d00f49e /refs
parentc4d9c506f7a802ed263071c82319098e3fcd0b3e (diff)
downloadgit-9b7b0295f9521262b50143e580f4eb27b7bb83a7.zip
git-9b7b0295f9521262b50143e580f4eb27b7bb83a7.tar.gz
git-9b7b0295f9521262b50143e580f4eb27b7bb83a7.tar.bz2
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index b1f8f53..d60767a 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;