[PATCH 2/2] commit: use strbuf_release() instead of UNLEAK()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert the UNLEAK() added in 0e5bba53af7 (add UNLEAK annotation for
reducing leak false positives, 2017-09-08) to release the memory using
strbuf_release() instead.

The tests being marked as passing with
"TEST_PASSES_SANITIZE_LEAK=true" already passed before due to the
UNLEAK(), but now they really don't leak memory, so let's mark them as
such.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 builtin/commit.c                 | 4 ++--
 t/t2203-add-intent.sh            | 1 +
 t/t7011-skip-worktree-reading.sh | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 696b3527adf..c38ae2b7656 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1866,7 +1866,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 cleanup:
 	strbuf_release(&author_ident);
-	UNLEAK(err);
-	UNLEAK(sb);
+	strbuf_release(&err);
+	strbuf_release(&sb);
 	return ret;
 }
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index db7ca559986..ebf58db2d18 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -2,6 +2,7 @@
 
 test_description='Intent to add'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'intent to add' '
diff --git a/t/t7011-skip-worktree-reading.sh b/t/t7011-skip-worktree-reading.sh
index 1761a2b1b99..4adac5acd57 100755
--- a/t/t7011-skip-worktree-reading.sh
+++ b/t/t7011-skip-worktree-reading.sh
@@ -5,6 +5,7 @@
 
 test_description='skip-worktree bit test'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 cat >expect.full <<EOF
-- 
2.35.1.1028.g2d2d4be19de




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux