submodule: fix leaking seen submodule names

We keep track of submodules we have already seen via a string map such
that we don't process the same submodule twice. We never free that map
though, causing a memory leak.

Fix this leak by clearing the map.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-08-08 09:35:56 +02:00
committed by Junio C Hamano
parent 1a7e5efdb0
commit fa0f27a19d
3 changed files with 3 additions and 0 deletions

View File

@ -1880,6 +1880,7 @@ int fetch_submodules(struct repository *r,
strvec_clear(&spf.args);
out:
free_submodules_data(&spf.changed_submodule_names);
string_list_clear(&spf.seen_submodule_names, 0);
return spf.result;
}