]> git.ipfire.org Git - thirdparty/git.git/commit
test-tool regex: call regfree(), fix memory leaks
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 1 Jul 2022 10:37:36 +0000 (12:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jul 2022 20:38:50 +0000 (13:38 -0700)
commita20b0dc796c1fd8998ba81c985261a376c866c9b
treeb350dc43f957c9ac383e87c212b07ef72c376846
parent1c343e5aef0599a7a4816aa7fce5c7c84c10388d
test-tool regex: call regfree(), fix memory leaks

Fix memory leaks in "test-tool regex" which have been there since
c91841594c2 (test-regex: Add a test to check for a bug in the regex
routines, 2012-09-01), as a result we can mark a test as passing with
SANITIZE=leak using "TEST_PASSES_SANITIZE_LEAK=true".

We could regfree() on the die() paths here, which would make some
invocations of valgrind(1) happy, but let's just target SANITIZE=leak
for now. Variables that are still reachable when we die() are not
reported as leaks.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-regex.c
t/t7812-grep-icase-non-ascii.sh