mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-21 06:23:52 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user