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>
This commit is contained in:
Patrick Steinhardt
2024-11-20 14:39:44 +01:00
committed by Junio C Hamano
parent 94aa96cd59
commit 889c597961

4
help.c
View File

@ -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;
}