diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-20 15:35:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-08-20 15:35:01 +0100 |
commit | 78b4c55e9ef58c9ca136607946ab5913151db7eb (patch) | |
tree | b33bc3297bab7d17d91209df83150b3354bdde0d /src | |
parent | 3386c4c30aec9767357f679c6b94656ab09517dd (diff) | |
download | rspamd-78b4c55e9ef58c9ca136607946ab5913151db7eb.tar.gz rspamd-78b4c55e9ef58c9ca136607946ab5913151db7eb.zip |
Fix lua maps processing.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index 2862c62de..5dfbe90d6 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -961,10 +961,11 @@ lua_map_read (rspamd_mempool_t *pool, gchar *chunk, gint len, struct lua_map_callback_data *cbdata, *old; if (data->cur_data == NULL) { - cbdata = g_slice_alloc (sizeof (*cbdata)); + cbdata = g_slice_alloc0 (sizeof (*cbdata)); old = (struct lua_map_callback_data *)data->prev_data; cbdata->L = old->L; cbdata->ref = old->ref; + data->cur_data = cbdata; } else { cbdata = (struct lua_map_callback_data *)data->cur_data; @@ -992,6 +993,7 @@ lua_map_fin (rspamd_mempool_t * pool, struct map_cb_data *data) g_string_free (old->data, TRUE); } g_slice_free1 (sizeof (*old), old); + data->prev_data = NULL; } if (data->cur_data) { |