summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-07-01 10:37:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-07-01 20:38:49 (GMT)
commit330ca8501b6b4cb7afec20dc0b9513542118e9de (patch)
treeccb23255977c428a8a7f81330c13d7702a23804a /t/helper
parente4a4b31577c7419497ac30cebe30d755b97752c5 (diff)
downloadgit-330ca8501b6b4cb7afec20dc0b9513542118e9de.zip
git-330ca8501b6b4cb7afec20dc0b9513542118e9de.tar.gz
git-330ca8501b6b4cb7afec20dc0b9513542118e9de.tar.bz2
test-tool test-hash: fix a memory leak
Fix a memory leak in "test-tool test-hash" which has been there since b57cbbf8a86 (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>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-hash.c b/t/helper/test-hash.c
index 261c545..5860dab 100644
--- a/t/helper/test-hash.c
+++ b/t/helper/test-hash.c
@@ -54,5 +54,6 @@ int cmd_hash_impl(int ac, const char **av, int algo)
fwrite(hash, 1, algop->rawsz, stdout);
else
puts(hash_to_hex_algop(hash, algop));
+ free(buffer);
return 0;
}