parse-options: fix leaks for users of OPT_FILENAME
The `OPT_FILENAME()` option will, if set, put an allocated string into the user-provided variable. Consequently, that variable thus needs to be free'd by the caller of `parse_options()`. Some callsites don't though and thus leak memory. Fix those. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
56931c4d89
commit
14da26230a
@ -207,6 +207,7 @@ int cmd__parse_options(int argc, const char **argv)
|
||||
expect.strdup_strings = 1;
|
||||
string_list_clear(&expect, 0);
|
||||
string_list_clear(&list, 0);
|
||||
free(file);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user