builtin/merge: fix leaking struct cmdnames in get_strategy()

In "builtin/merge.c" we use the helper infrastructure to figure out what
merge strategies there are. We never free contents of the `cmdnames`
structures though and thus leak their memory.

Fix this by exposing the already existing `clean_cmdnames()` function to
release their memory. As this name isn't quite idiomatic, rename it to
`cmdnames_release()` while at it.

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-06-11 11:21:06 +02:00
committed by Junio C Hamano
parent 6e95f4ee03
commit 77241a6b5e
4 changed files with 16 additions and 9 deletions

2
help.h
View File

@ -13,6 +13,8 @@ struct cmdnames {
} **names;
};
void cmdnames_release(struct cmdnames *cmds);
static inline void mput_char(char c, unsigned int num)
{
while (num--)