diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-11-20 14:39:46 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-21 08:23:44 +0900 |
commit | 2379b5c90038b2c334ff62cce62d50b4a8e78360 (patch) | |
tree | 2941ab99c83742c28541861e5b5cb970ff9595d4 /git-gui/lib/commit.tcl | |
parent | 7720dbe99b303b3d658898587e02d7cf224a93c3 (diff) |
builtin/help: fix leaks in `check_git_cmd()`
The `check_git_cmd()` function is declared to return a string constant.
And while it sometimes does return a constant, it may also return an
allocated string in two cases:
- When handling aliases. This case is already marked with `UNLEAK()`
to work around the leak.
- When handling unknown commands in case "help.autocorrect" is
enabled. This one is not marked with `UNLEAK()`.
The function only has a single caller, so let's fix its return type to
be non-constant, consistently return an allocated string and free it at
its callsite to plug the leak.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions