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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jun 4, 2024 at 06:13 UTC
a544b7da2c91f07c6d22d9c0b72911d32f836c54
1 file changed
+2
builtin/sparse-checkout.c
+2
@@ -95,6 +95,8 @@ static int sparse_checkout_list(int argc, const char **argv, const char *prefix)
95
quote_c_style(sl.items[i].string, NULL, stdout, 0);
96
printf("\n");
97
}
98
+
99
+ string_list_clear(&sl, 0);
100
} else {
101
write_patterns_to_file(stdout, &pl);
102
}