summaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-11-20 14:39:44 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-21 00:23:44 +0100
commit889c597961cb8dfc0255f520a270aafe125b9869 (patch)
tree43286fd27b5223368c6acdbec69bc930a2ba20e9 /help.c
parenthelp: refactor to not use globals for reading config (diff)
downloadgit-889c597961cb8dfc0255f520a270aafe125b9869.tar.xz
git-889c597961cb8dfc0255f520a270aafe125b9869.zip
help: fix leaking `struct cmdnames`
We're populating multiple `struct cmdnames`, but don't ever free them. Plug this memory leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/help.c b/help.c
index 8794f81db9..8b56cd6e25 100644
--- a/help.c
+++ b/help.c
@@ -723,6 +723,10 @@ const char *help_unknown_cmd(const char *cmd)
(float)cfg.autocorrect/10.0, assumed);
sleep_millisec(cfg.autocorrect * 100);
}
+
+ cmdnames_release(&cfg.aliases);
+ cmdnames_release(&main_cmds);
+ cmdnames_release(&other_cmds);
return assumed;
}