]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/pack-refs: release allocated memory
authorPatrick Steinhardt <ps@pks.im>
Mon, 25 Mar 2024 10:03:15 +0000 (11:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Mar 2024 16:54:07 +0000 (09:54 -0700)
commita75dc71f3772cee10dfb93861610d8ee413ad207
tree385930a30d72da11bb9d251b76af515069436b84
parentf89356db4a26eef47aceb2d03039fff6b1a4180d
builtin/pack-refs: release allocated memory

Some of the command line options in `cmd_pack_refs()` require us to
allocate memory. This memory is never released and thus leaking, but we
paper over this leak by declaring the respective variables as `static`
function-level variables, which is somewhat awkward.

Refactor the code to release the allocated memory and drop the `static`
declaration. While at it, remove the useless `flags` variable.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-refs.c