summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-09 17:13:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-09 17:13:14 (GMT)
commit9179380aa616af0118bb85288e6a1b5c5c91b7ef (patch)
treefe014cf20b06c74762f4b0b75da438fdc045d73f /t
parent203cf46fac096185701e50cdbf972ba6a67a10c8 (diff)
parent7df3bd462a7e8cd18f16ae33acc49fac15db7c3e (diff)
downloadgit-9179380aa616af0118bb85288e6a1b5c5c91b7ef.zip
git-9179380aa616af0118bb85288e6a1b5c5c91b7ef.tar.gz
git-9179380aa616af0118bb85288e6a1b5c5c91b7ef.tar.bz2
Merge branch 'mt/dir-iterator-updates'
Leakfix. * mt/dir-iterator-updates: test-dir-iterator: use path argument directly dir-iterator: release strbuf after use
Diffstat (limited to 't')
-rw-r--r--t/helper/test-dir-iterator.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/t/helper/test-dir-iterator.c b/t/helper/test-dir-iterator.c
index c7c3066..659b6bf 100644
--- a/t/helper/test-dir-iterator.c
+++ b/t/helper/test-dir-iterator.c
@@ -19,7 +19,6 @@ static const char *error_name(int error_number)
*/
int cmd__dir_iterator(int argc, const char **argv)
{
- struct strbuf path = STRBUF_INIT;
struct dir_iterator *diter;
unsigned int flags = 0;
int iter_status;
@@ -36,8 +35,7 @@ int cmd__dir_iterator(int argc, const char **argv)
if (!*argv || argc != 1)
die("dir-iterator needs exactly one non-option argument");
- strbuf_add(&path, *argv, strlen(*argv));
- diter = dir_iterator_begin(path.buf, flags);
+ diter = dir_iterator_begin(*argv, flags);
if (!diter) {
printf("dir_iterator_begin failure: %s\n", error_name(errno));