[PATCH 16/23] pack-bitmap-write: fix leaking OID array

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

 



Fix a leaking OID array in `write_pseudo_merges()`.

Signed-off-by: Patrick Steinhardt <ps@xxxxxx>
---
 pack-bitmap-write.c             | 1 +
 t/t5333-pseudo-merge-bitmaps.sh | 1 +
 2 files changed, 2 insertions(+)

diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 6413dd1731..49758e2525 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -913,6 +913,7 @@ static void write_pseudo_merges(struct bitmap_writer *writer,
 	for (i = 0; i < writer->pseudo_merges_nr; i++)
 		bitmap_free(commits_bitmap[i]);
 
+	oid_array_clear(&commits);
 	free(pseudo_merge_ofs);
 	free(commits_bitmap);
 }
diff --git a/t/t5333-pseudo-merge-bitmaps.sh b/t/t5333-pseudo-merge-bitmaps.sh
index 1dd6284756..eca4a1eb8c 100755
--- a/t/t5333-pseudo-merge-bitmaps.sh
+++ b/t/t5333-pseudo-merge-bitmaps.sh
@@ -4,6 +4,7 @@ test_description='pseudo-merge bitmaps'
 
 GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_pseudo_merges () {
-- 
2.46.2.852.g229c0bf0e5.dirty





[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