diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-01 12:40:21 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-01 08:47:36 -0700 |
| commit | 2d197e4a0f34b97b03416666bebcb993e41fed26 (patch) | |
| tree | d02e8d86af266c6c7e7fc33b7495379126f67a38 /commit-reach.c | |
| parent | builtin/stash: fix various trivial memory leaks (diff) | |
| download | git-2d197e4a0f34b97b03416666bebcb993e41fed26.tar.gz git-2d197e4a0f34b97b03416666bebcb993e41fed26.zip | |
builtin/rev-parse: fix memory leak with `--parseopt`
The `--parseopt` mode allows shell scripts to have the same option
parsing mode as we have in C builtins. It soaks up a set of option
descriptions via stdin and massages them into proper `struct option`s
that we can then use to parse a set of arguments.
We only partially free those options when done though, creating a memory
leak. Interestingly, we only end up free'ing the first option's help,
which is of course wrong.
Fix this by freeing all option's help fields as well as their `argh`
fields to plug this memory leak.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-reach.c')
0 files changed, 0 insertions, 0 deletions
