Skip to content

Commit df25a19

Browse files
hanwengitster
authored andcommitted
test-ref-store: plug memory leak in cmd_delete_refs
Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cd2d40f commit df25a19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/helper/test-ref-store.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,14 @@ static int cmd_delete_refs(struct ref_store *refs, const char **argv)
138138
unsigned int flags = arg_flags(*argv++, "flags", transaction_flags);
139139
const char *msg = *argv++;
140140
struct string_list refnames = STRING_LIST_INIT_NODUP;
141+
int result;
141142

142143
while (*argv)
143144
string_list_append(&refnames, *argv++);
144145

145-
return refs_delete_refs(refs, msg, &refnames, flags);
146+
result = refs_delete_refs(refs, msg, &refnames, flags);
147+
string_list_clear(&refnames, 0);
148+
return result;
146149
}
147150

148151
static int cmd_rename_ref(struct ref_store *refs, const char **argv)

0 commit comments

Comments
 (0)