]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail-crypt: test-mail-key - Skip test before allocating test_pool
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Fri, 26 Jul 2019 08:55:11 +0000 (11:55 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 10 Sep 2019 07:02:03 +0000 (10:02 +0300)
Fixes a memory leak if test is skipped.

src/plugins/mail-crypt/test-mail-key.c

index 244503e1ed1c4540478806d6815b75145a1d08a9..c4b73fdb15ebdf83fd1b8a3d0204702cc2e84f84 100644 (file)
@@ -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);