diff mbox series

[v3,03/11] t-reftable-block: release used block reader

Message ID 20240821124150.4463-4-chandrapratap3519@gmail.com (mailing list archive)
State Accepted
Commit 353672f9f894294d10c85f082f53d591f438e209
Headers show
Series t: port reftable/block_test.c to the unit testing framework | expand

Commit Message

Chandra Pratap Aug. 21, 2024, 12:30 p.m. UTC
Used block readers must be released using block_reader_release() to
prevent the occurence of a memory leak. Make test_block_read_write()
conform to this statement.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
---
 t/unit-tests/t-reftable-block.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/t/unit-tests/t-reftable-block.c b/t/unit-tests/t-reftable-block.c
index b1b238ac2a..eafe1fdee9 100644
--- a/t/unit-tests/t-reftable-block.c
+++ b/t/unit-tests/t-reftable-block.c
@@ -105,6 +105,7 @@  static void t_block_read_write(void)
 		block_iter_close(&it);
 	}
 
+	block_reader_release(&br);
 	reftable_record_release(&rec);
 	reftable_block_done(&br.block);
 	strbuf_release(&want);