diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-11-20 14:39:42 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-21 08:23:43 +0900 |
commit | 58e7568c619cce872b17987f0d14b3de3703129a (patch) | |
tree | 36ffbfd95bcc4542e3a1ae3b8c725dcc210377af /gitweb/static/js/lib/common-lib.js | |
parent | a5408d1820e0ea75612bbd6f6a6c495066e5ffcb (diff) |
builtin/sparse-checkout: fix leaking sanitized patterns
Both `git sparse-checkout add` and `git sparse-checkout set` accept a
list of additional directories or patterns. These get massaged via calls
to `sanitize_paths()`, which may end up modifying the passed-in array by
updating its pointers to be prefixed paths. This allocates memory that
we never free.
Refactor the code to instead use a `struct strvec`, which makes it way
easier for us to track the lifetime correctly. The couple of extra
memory allocations likely do not matter as we only ever populate it with
command line arguments.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/static/js/lib/common-lib.js')
0 files changed, 0 insertions, 0 deletions