mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
rerere: fix various trivial leaks
We leak various different string lists in the rerere code. Free those to plug them. Note that the `merge_rr` variable is intentionally being free'd with the `free_util` parameter set to 1. The `util` field is used there to store the IDs of every rerere item and thus needs to be freed, as well. 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
748bd0943b
commit
f46ede661f
3
rerere.c
3
rerere.c
@@ -849,6 +849,8 @@ static int do_plain_rerere(struct repository *r,
|
||||
if (update.nr)
|
||||
update_paths(r, &update);
|
||||
|
||||
string_list_clear(&conflict, 0);
|
||||
string_list_clear(&update, 0);
|
||||
return write_rr(rr, fd);
|
||||
}
|
||||
|
||||
@@ -912,6 +914,7 @@ int repo_rerere(struct repository *r, int flags)
|
||||
return 0;
|
||||
status = do_plain_rerere(r, &merge_rr, fd);
|
||||
free_rerere_dirs();
|
||||
string_list_clear(&merge_rr, 1);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user