sparse-checkout: free string list in write_cone_to_file()
We use a string list to hold sorted and de-duped patterns, but don't free it before leaving the function, causing a leak. This drops the number of leaks found in t7002 from 27 to 25. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
94d25d3254
commit
2181fe6e46
|
@ -311,6 +311,8 @@ static void write_cone_to_file(FILE *fp, struct pattern_list *pl)
|
|||
fprintf(fp, "%s/\n", pattern);
|
||||
free(pattern);
|
||||
}
|
||||
|
||||
string_list_clear(&sl, 0);
|
||||
}
|
||||
|
||||
static int write_patterns_and_update(struct pattern_list *pl)
|
||||
|
|
Loading…
Reference in New Issue