]> Kevux Git Server - rit/commit
biultin/rev-parse: fix memory leaks in `--parseopt` mode
authorPatrick Steinhardt <ps@pks.im>
Tue, 11 Jun 2024 09:19:36 +0000 (11:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Jun 2024 20:15:05 +0000 (13:15 -0700)
commitafb0653d2373dc72ad4a9c89b7d17b660d194f04
treeddfb867e843bb1d3dd83b3739bb7a1dfc4db874c
parent11ee9a75e7d6f149431f69400c81006f8ccecad5
biultin/rev-parse: fix memory leaks in `--parseopt` mode

We have a bunch of memory leaks in git-rev-parse(1)'s `--parseopt` mode.
Refactor the code to use `struct strvec`s to make it easier for us to
track the lifecycle of those leaking variables and then free them.

While at it, remove the unneeded static lifetime for some of the
variables.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c
t/t5150-request-pull.sh
t/t7006-pager.sh