summaryrefslogtreecommitdiff
path: root/gitweb/static/js/lib/common-lib.js
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-11-20 14:39:39 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-21 08:23:42 +0900
commitffc5c046fb4f47e149687963706bb2390f4eed61 (patch)
tree19cdd8a492a753c341c5fbddaf98e2e8e169315c /gitweb/static/js/lib/common-lib.js
parent3f5fadef3718f0ada963aeb25be70c8ba71b5c7c (diff)
git: refactor alias handling to use a `struct strvec`
In `handle_alias()` we use both `argcp` and `argv` as in-out parameters. Callers mostly pass through the static array from `main()`, but once we handle an alias we replace it with an allocated array that may contain some allocated strings. Callers do not handle this scenario at all and thus leak memory. We could in theory handle the lifetime of `argv` in a hacky fashion by letting callers free it in case they see that an alias was handled. But while that would likely work, we still wouldn't be able to easily handle the lifetime of strings referenced by `argv`. Refactor the code to instead use a `struct strvec`, which effectively removes the need for us to manually track lifetimes. 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