]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack: fix leaking configuration
authorPatrick Steinhardt <ps@pks.im>
Thu, 26 Sep 2024 11:46:40 +0000 (13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Sep 2024 15:25:36 +0000 (08:25 -0700)
commitdea4a9521ea134bbc12bce492b1ae467f5ff1bd1
tree22052d3a9822c2181217b64a4366b46df645f1f6
parent6932ec81834003855486547cdc561cbbdd335389
builtin/repack: fix leaking configuration

When repacking, we assemble git-pack-objects(1) arguments both for the
"normal" pack and for the cruft pack. This configuration gets populated
with a bunch of `OPT_PASSTHRU` options that we end up passing to the
child process. These options are allocated, but never free'd.

Create a new `pack_objects_args_release()` function that releases the
memory for us and call it for both sets of options.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
t/t5329-pack-objects-cruft.sh
t/t7700-repack.sh