From 889c597961cb8dfc0255f520a270aafe125b9869 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 20 Nov 2024 14:39:44 +0100 Subject: [PATCH] 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 --- help.c | 4 ++++ 1 file changed, 4 insertions(+) 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; }