]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack: fix leaking line buffer when packing promisors
authorPatrick Steinhardt <ps@pks.im>
Thu, 5 Sep 2024 10:09:23 +0000 (12:09 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Sep 2024 15:49:12 +0000 (08:49 -0700)
commit860b6780163ade3bb705d6565619ec13efcc77c6
treee0dd948ebe83aff428f88331062d3c449b448e5b
parenta46f231975f4c7ac94af0847f4b3bb8b11493d80
builtin/repack: fix leaking line buffer when packing promisors

In `repack_promisor_objects()` we read output from git-pack-objects(1)
line by line, using `strbuf_getline_lf()`. We never free the line
buffer, causing a memory leak. Plug it.

This leak is being hit in t5616, but plugging it alone is not
sufficient to make the whole test suite leak free.

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