]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/grep: fix leak with `--max-count=0`
authorPatrick Steinhardt <ps@pks.im>
Tue, 5 Nov 2024 06:16:52 +0000 (07:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Nov 2024 06:37:52 +0000 (22:37 -0800)
commit43fedde3dfcd1e0ccd638f1a8c70c39219680fb1
tree8a1c647069ad2de3d6a1cc7f5e9aec21839230fa
parenta6590ccdd431e2ab7b9c521cac674546725a54d2
builtin/grep: fix leak with `--max-count=0`

When executing with `--max-count=0` we'll return early from git-grep(1)
without performing any cleanup, which causes memory leaks. Plug these.

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