[PATCH v3 15/27] help: fix leaking `struct cmdnames`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 20, 2024, 13:39 UTC
- Message-ID
- <20241120-b4-pks-leak-fixes-pt10-v3-15-d67f08f45c74@pks.im>
- In-Reply-To
- <20241120-b4-pks-leak-fixes-pt10-v3-0-d67f08f45c74@pks.im>
We're populating multiple `struct cmdnames`, but don't ever free them. Plug this memory leak.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- help.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/help.c b/help.c index 8794f81db9bbf457b7cabca59222299922f3cc7f..8b56cd6e25ba5f2be2cbf2a7a9ed48136e12a0c7 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; }
-- 2.47.0.274.g962d0b743d.dirty