]> git.ipfire.org Git - thirdparty/git.git/commit
fetch-pack: free object filter before exiting
authorJeff King <peff@peff.net>
Tue, 24 Sep 2024 21:52:07 +0000 (17:52 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Sep 2024 17:24:53 +0000 (10:24 -0700)
commit0c23f1a9e40038296e5479bedaf27d93f9fdba6a
tree23fb2a7e8839a058cf4af7ca4e920bee685e5a7b
parent91aa67353971e994596e9cae77d6ec1d8feefa84
fetch-pack: free object filter before exiting

Our fetch_pack_args holds a filter_options struct that may be populated
with allocated strings by the by the "--filter" command-line option. We
must free it before exiting to avoid a leak when the program exits.

The usual fetch code paths that use transport.c don't have the same
leak, because we do the cleanup in disconnect_git().

Fixing this leak lets us mark t5500 as leak-free.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch-pack.c
t/t5500-fetch-pack.sh