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.
This commit is contained in:
Max Lv
2026-08-20 09:14:04 +08:00
parent 8cc58cea95
commit fdde2c7cee
+6 -1
View File
@@ -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;
}