aboutsummaryrefslogtreecommitdiffstats
path: root/help.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-11 11:21:06 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-11 13:15:07 -0700
commit77241a6b5e3aadbc697632600e7e187ae94c4ca6 (patch)
treef0dec6279a729166fdaa409b0c4145f1358a9dc2 /help.h
parent6e95f4ee0394b7ed8ee42b5d0d22d35b20af16a9 (diff)
downloadgit-77241a6b5e3aadbc697632600e7e187ae94c4ca6.tar.gz
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>
Diffstat (limited to 'help.h')
-rw-r--r--help.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/help.h b/help.h
index af073a7a02..e716ee27ea 100644
--- a/help.h
+++ b/help.h
@@ -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--)