]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dict-sql: Fixed memory leak
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 May 2016 15:25:06 +0000 (18:25 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 May 2016 15:25:06 +0000 (18:25 +0300)
src/lib-dict/dict-sql-settings.c

index 5b090061edd1860d82fbe88950dfaa8eeb200204..25e08bbf55eec0dcc1e41bc24a6e4c96bffc1739 100644 (file)
@@ -248,7 +248,7 @@ dict_sql_settings_read(const char *path, const char **error_r)
 {
        struct setting_parser_ctx ctx;
        struct dict_sql_settings_cache *cache;
-       pool_t pool = pool_alloconly_create("dict sql settings", 1024);
+       pool_t pool;
 
        if (!hash_table_is_created(dict_sql_settings_cache)) {
                hash_table_create(&dict_sql_settings_cache, default_pool, 0,
@@ -260,6 +260,7 @@ dict_sql_settings_read(const char *path, const char **error_r)
                return cache->set;
 
        memset(&ctx, 0, sizeof(ctx));
+       pool = pool_alloconly_create("dict sql settings", 1024);
        ctx.pool = pool;
        ctx.set = p_new(pool, struct dict_sql_settings, 1);
        t_array_init(&ctx.cur_fields, 16);