]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/fast-export: fix leaking diff options
authorPatrick Steinhardt <ps@pks.im>
Wed, 14 Aug 2024 06:52:26 +0000 (08:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Aug 2024 17:07:59 +0000 (10:07 -0700)
commit8ed4e96b5bcbd98e8d9f4593d53d8729280f47b9
tree99b6a23fe0ab04f10f284fd32125922dcc429983
parent0662f0dacb59de2aa56f41c7d8645784c2174ca7
builtin/fast-export: fix leaking diff options

Before calling `handle_commit()` in a loop, we set `diffopt.no_free`
such that its contents aren't getting freed inside of `handle_commit()`.
We never unset that flag though, which means that the structure's
allocated resources will ultimately leak.

Fix this by unsetting the flag after the loop such that we release its
resources via `release_revisions()`.

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