diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-01 12:38:25 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-01 08:47:35 -0700 |
| commit | 5a1e1e5d4055e142369a05a6d71e5101eead8ab2 (patch) | |
| tree | 99b9e3875eeb6fc0e1f30bcbafa90ca6850bdccf /commit-reach.c | |
| parent | builtin/describe: fix memory leak with `--contains=` (diff) | |
| download | git-5a1e1e5d4055e142369a05a6d71e5101eead8ab2.tar.gz git-5a1e1e5d4055e142369a05a6d71e5101eead8ab2.zip | |
builtin/describe: fix leaking array when running diff-index
When running git-describe(1) with `--dirty`, we will set up a `struct
rev_info` with arguments for git-diff-index(1). The way we assemble the
arguments it causes two memory leaks though:
- We never release the `struct strvec`.
- `setup_revisions()` may end up removing some entries from the
`strvec`, which we wouldn't free even if we released the struct.
While we could plug those leaks, this is ultimately unnecessary as the
arguments we pass are part of a static array anyway. So instead,
refactor the code to drop the `struct strvec` and just pass this static
array directly.
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
