From 6771e2012e15ed3748997566640c34b492c2cf67 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 1 Aug 2024 12:39:57 +0200 Subject: builtin/submodule--helper: fix leaking buffer in `is_tip_reachable` The `rev` buffer in `is_tip_reachable()` is being populated with the output of git-rev-list(1) -- if either the command fails or the buffer contains any data, then the input commit is not reachable. The buffer isn't used for anything else, but neither do we free it, causing a memory leak. Fix this. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/t7400-submodule-basic.sh | 1 + 1 file changed, 1 insertion(+) (limited to 't/t7400-submodule-basic.sh') diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 981488885f..098d8833b6 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -12,6 +12,7 @@ subcommands of git submodule. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh test_expect_success 'setup - enable local submodules' ' -- cgit v1.3