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>
Patrick Steinhardt committed
Nov 20, 2024 at 14:39 UTC
889c597961cb8dfc0255f520a270aafe125b9869
1 file changed
+4
help.c
+4
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;
}