Skip to content

Commit 889c597

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 94aa96c commit 889c597

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

help.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,10 @@ const char *help_unknown_cmd(const char *cmd)
723723
(float)cfg.autocorrect/10.0, assumed);
724724
sleep_millisec(cfg.autocorrect * 100);
725725
}
726+
727+
cmdnames_release(&cfg.aliases);
728+
cmdnames_release(&main_cmds);
729+
cmdnames_release(&other_cmds);
726730
return assumed;
727731
}
728732

0 commit comments

Comments
 (0)