]> git.99rst.org Git - git.git/commit
builtin/grep: fix leaking object context
authorPatrick Steinhardt <redacted>
Thu, 5 Sep 2024 10:09:31 +0000 (12:09 +0200)
committerJunio C Hamano <redacted>
Thu, 5 Sep 2024 15:49:12 +0000 (08:49 -0700)
commitee087c29c89ad54980f2521641f5f182f6adbc79
treea9a1e82fc009128bc50c0c279f4ce5c22484367f
parent149c83e0aa1ee75b2da9c27ce5a819025260b4da
builtin/grep: fix leaking object context

Even when `get_oid_with_context()` fails it may have allocated some data
in the object context. But we do not release it in git-grep(1) when the
call fails, leading to a memory leak. Plug it.

Signed-off-by: Patrick Steinhardt <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/grep.c
t/t6132-pathspec-exclude.sh
t/t6135-pathspec-with-attrs.sh
git clone https://git.99rst.org/PROJECT