submodule: fix leaking submodule entry list

The submodule entry list returned by `submodules_of_tree()` is never
completely free'd by its only caller. Introduce a new function that
free's the list for us and call it.

While at it, also fix the leaking `branch_point` string.

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-09-30 11:13:27 +02:00
committed by Junio C Hamano
parent 666643fa89
commit 5cca114973
4 changed files with 24 additions and 3 deletions

View File

@@ -136,4 +136,7 @@ struct submodule_entry_list {
void submodules_of_tree(struct repository *r,
const struct object_id *treeish_name,
struct submodule_entry_list *ret);
void submodule_entry_list_release(struct submodule_entry_list *list);
#endif /* SUBMODULE_CONFIG_H */