1
0
mirror of https://github.com/git/git.git synced 2024-09-24 03:11:22 +02:00

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>
This commit is contained in:
Han-Wen Nienhuys 2021-12-07 13:38:15 +00:00 committed by Junio C Hamano
parent cd2d40fb7f
commit df25a19d72

View File

@ -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)