test-tool test-hash: fix a memory leak
Fix a memory leak in "test-tool test-hash" which has been there since
b57cbbf8a8
(test-sha1: test hashing large buffer, 2006-06-24), as a
result we can mark more tests as passing with SANITIZE=leak using
"TEST_PASSES_SANITIZE_LEAK=true".
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e4a4b31577
commit
330ca8501b
@ -54,5 +54,6 @@ int cmd_hash_impl(int ac, const char **av, int algo)
|
|||||||
fwrite(hash, 1, algop->rawsz, stdout);
|
fwrite(hash, 1, algop->rawsz, stdout);
|
||||||
else
|
else
|
||||||
puts(hash_to_hex_algop(hash, algop));
|
puts(hash_to_hex_algop(hash, algop));
|
||||||
|
free(buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test basic hash implementation'
|
test_description='test basic hash implementation'
|
||||||
. ./test-lib.sh
|
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'test basic SHA-1 hash values' '
|
test_expect_success 'test basic SHA-1 hash values' '
|
||||||
test-tool sha1 </dev/null >actual &&
|
test-tool sha1 </dev/null >actual &&
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='handling of duplicate objects in incoming packfiles'
|
test_description='handling of duplicate objects in incoming packfiles'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-pack.sh
|
. "$TEST_DIRECTORY"/lib-pack.sh
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test index-pack handling of delta cycles in packfiles'
|
test_description='test index-pack handling of delta cycles in packfiles'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-pack.sh
|
. "$TEST_DIRECTORY"/lib-pack.sh
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
test_description='git pack-object with "large" deltas
|
test_description='git pack-object with "large" deltas
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-pack.sh
|
. "$TEST_DIRECTORY"/lib-pack.sh
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user