]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: stop tests from leaking memory
authorPhil Carmody <phil@dovecot.fi>
Mon, 16 Nov 2015 10:26:50 +0000 (12:26 +0200)
committerPhil Carmody <phil@dovecot.fi>
Mon, 16 Nov 2015 10:26:50 +0000 (12:26 +0200)
This permits Valgrind to run without complaint.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib-master/test-master-service-settings-cache.c

index 4aee183b446a2cd1d31d185b7f327cc2605dba5a..ad7fc32a3ab415ec05c8fb3f967bd326de06e269 100644 (file)
@@ -98,15 +98,20 @@ int main(void)
                test_master_service_settings_cache,
                NULL
        };
+       pool_t pool;
+       int ret;
 
        memset(&input, 0, sizeof(input));
        input.module = "module";
        input.service = "service_name";
 
        set.config_cache_size = 1024*4;
+       pool = pool_alloconly_create("set pool", 1024);
        test_master_service.set_parser =
-               settings_parser_init(pool_alloconly_create("set pool", 1024),
-                       &test_setting_parser_info, 0);
+               settings_parser_init(pool, &test_setting_parser_info, 0);
        master_service = &test_master_service;
-       return test_run(test_functions);
+       ret = test_run(test_functions);
+       settings_parser_deinit(&test_master_service.set_parser);
+       pool_unref(&pool);
+       return ret;
 }