Skip to content

Commit a544b7d

Browse files
peffgitster
authored andcommitted
sparse-checkout: free string list after displaying
In sparse_checkout_list(), we put the hashmap entries into a string_list so we can sort them. But after printing, we forget to free the list. This patch drops 5 leaks from t1091. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 521e04e commit a544b7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/sparse-checkout.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
9595
quote_c_style(sl.items[i].string, NULL, stdout, 0);
9696
printf("\n");
9797
}
98+
99+
string_list_clear(&sl, 0);
98100
} else {
99101
write_patterns_to_file(stdout, &pl);
100102
}

0 commit comments

Comments
 (0)