diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-08-01 12:40:02 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-08-01 08:47:36 -0700 |
| commit | 4119fc08e2ed5611c21de9162b3ab61ef0014ada (patch) | |
| tree | 9eaf2e72524fb875ece036cb061b9b574248f4a1 /commit-reach.c | |
| parent | builtin/submodule--helper: fix leaking buffer in `is_tip_reachable` (diff) | |
| download | git-4119fc08e2ed5611c21de9162b3ab61ef0014ada.tar.gz git-4119fc08e2ed5611c21de9162b3ab61ef0014ada.zip | |
builtin/ls-remote: fix leaking `pattern` strings
Users can pass patterns to git-ls-remote(1), which allows them to filter
the list of printed references. We assemble those patterns into an array
and prefix them with "*/", but never free either the array nor the
allocated strings.
Refactor the code to use a `struct strvec` instead of manually tracking
the strings in an array. Like this, we can easily use `strvec_clear()`
to release both the vector and the contained string for us, plugging the
leak.
Helped-by: Taylor Blau <me@ttaylorr.com>
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
