summaryrefslogtreecommitdiffstats
path: root/submodule.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-08 09:35:56 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-08 18:22:21 +0200
commitfa0f27a19d4e2606ec24d9d4aed4f6c8df986370 (patch)
tree0469ce4a2235a21b672b5413b77b44866b43208c /submodule.c
parentsubmodule: fix leaking fetch tasks (diff)
downloadgit-fa0f27a19d4e2606ec24d9d4aed4f6c8df986370.tar.xz
git-fa0f27a19d4e2606ec24d9d4aed4f6c8df986370.zip
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>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index f027a6455e..13b8f8c19c 100644
--- a/submodule.c
+++ b/submodule.c
@@ -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;
}