summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Han-Wen Nienhuys <hanwen@google.com>2021-12-07 13:38:15 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-07 13:15:19 -0800
commitdf25a19d7287798a4ab2b5df08377fe7492a3846 (patch)
tree8e8503cd53d09c389b587028fc65354f20af60d5
parenttest-ref-store: parse symbolic flag constants (diff)
downloadtgif-df25a19d7287798a4ab2b5df08377fe7492a3846.tar.xz
test-ref-store: plug memory leak in cmd_delete_refs
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/helper/test-ref-store.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index abb0ba101a..8fee3cfce1 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -138,11 +138,14 @@ static int cmd_delete_refs(struct ref_store *refs, const char **argv)
unsigned int flags = arg_flags(*argv++, "flags", transaction_flags);
const char *msg = *argv++;
struct string_list refnames = STRING_LIST_INIT_NODUP;
+ int result;
while (*argv)
string_list_append(&refnames, *argv++);
- return refs_delete_refs(refs, msg, &refnames, flags);
+ result = refs_delete_refs(refs, msg, &refnames, flags);
+ string_list_clear(&refnames, 0);
+ return result;
}
static int cmd_rename_ref(struct ref_store *refs, const char **argv)