submodule: fix leaking update strategy

We're not freeing the submodule update strategy command. Provide a
helper function that does this for us and call it in
`update_data_release()`.

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-26 13:46:08 +02:00
committed by Junio C Hamano
parent 3aef7a05ad
commit 2e492f2047
5 changed files with 12 additions and 3 deletions

View File

@ -424,6 +424,11 @@ int parse_submodule_update_strategy(const char *value,
return 0;
}
void submodule_update_strategy_release(struct submodule_update_strategy *strategy)
{
free((char *) strategy->command);
}
const char *submodule_update_type_to_string(enum submodule_update_type type)
{
switch (type) {