From: Siavash Tavakoli Date: Fri, 26 Jul 2019 08:55:11 +0000 (+0300) Subject: mail-crypt: test-mail-key - Skip test before allocating test_pool X-Git-Tag: 2.3.8~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83d9e580d4aff465e374aff45f77d71d6e9718b7;p=thirdparty%2Fdovecot%2Fcore.git mail-crypt: test-mail-key - Skip test before allocating test_pool Fixes a memory leak if test is skipped. --- diff --git a/src/plugins/mail-crypt/test-mail-key.c b/src/plugins/mail-crypt/test-mail-key.c index 244503e1ed..c4b73fdb15 100644 --- a/src/plugins/mail-crypt/test-mail-key.c +++ b/src/plugins/mail-crypt/test-mail-key.c @@ -449,12 +449,12 @@ static void test_setup(void) struct dcrypt_settings set = { .module_dir = top_builddir "/src/lib-dcrypt/.libs" }; - test_pool = pool_alloconly_create(MEMPOOL_GROWING "mcp test pool", 128); - test_ioloop = io_loop_create(); if (!dcrypt_initialize(NULL, &set, NULL)) { i_info("No functional dcrypt backend found - skipping tests"); test_exit(0); } + test_pool = pool_alloconly_create(MEMPOOL_GROWING "mcp test pool", 128); + test_ioloop = io_loop_create(); /* allocate a user */ if (init_test_mail_user() < 0) { test_exit(1);