Skip to content

Commit

Permalink
dict-sql: Fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed May 26, 2016
1 parent a2f4214 commit a436e90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-dict/dict-sql-settings.c
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit a436e90

Please sign in to comment.