From fdde2c7cee22a3e616cb79dcc80f0d254ab8950a Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 20 Aug 2026 09:14:04 +0800 Subject: [PATCH] Release the bloom filter in the AEAD-2022 tests crypto_init() initializes the nonce bloom filter on every call, so a test that builds a crypto_t per case has to tear it down per case as well. Freeing only once at the end leaked a pair of filters for every crypto_t after the first, which the valgrind memcheck job caught. test_crypto.c already frees it alongside each crypto_t; do the same here by folding it into the local free_crypto() helper. --- tests/test_aead2022.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_aead2022.c b/tests/test_aead2022.c index 7afdbaab..4a106b1b 100644 --- a/tests/test_aead2022.c +++ b/tests/test_aead2022.c @@ -49,6 +49,12 @@ make_crypto(const char *method) static void free_crypto(crypto_t *c) { + /* + * crypto_init() sets up the nonce bloom filter each time it is called, + * so it has to be torn down with every crypto_t or each test leaks a + * fresh pair of filters. + */ + ppbloom_free(); ss_free(c->cipher); ss_free(c); } @@ -382,6 +388,5 @@ main(void) test_udp_replay_rejected(m); } - ppbloom_free(); return 0; }