From: Patrick Steinhardt Date: Wed, 20 Nov 2024 13:39:44 +0000 (+0100) Subject: help: fix leaking `struct cmdnames` X-Git-Tag: v2.48.0-rc0~37^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889c597961cb8dfc0255f520a270aafe125b9869;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- 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; }