]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix various settings issues
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Jun 2019 11:16:29 +0000 (12:16 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 17 Jun 2019 11:16:48 +0000 (12:16 +0100)
src/libserver/rspamd_symcache.c
src/lua/lua_common.c

index 3560957afaa950fd8eb38cd15289e477ea634c81..5a4a002c331ca5bfc23417f2716ed15e9485235b 100644 (file)
@@ -3203,7 +3203,8 @@ rspamd_symcache_add_id_to_list (rspamd_mempool_t *pool,
                        g_assert (ls->dyn.allocated <= G_MAXINT16);
                        ls->dyn.allocated *= 2;
 
-                       new_array = rspamd_mempool_alloc (pool, ls->dyn.allocated);
+                       new_array = rspamd_mempool_alloc (pool,
+                                       ls->dyn.allocated * sizeof (guint32));
                        memcpy (new_array, ls->dyn.n, ls->dyn.len * sizeof (guint32));
                        ls->dyn.n = new_array;
                        ls->dyn.n[ls->dyn.len++] = id;
@@ -3222,7 +3223,8 @@ rspamd_symcache_add_id_to_list (rspamd_mempool_t *pool,
                }
                else {
                        /* Switch to dynamic */
-                       new_array = rspamd_mempool_alloc (pool, G_N_ELEMENTS (ls->st) * 2);
+                       new_array = rspamd_mempool_alloc (pool,
+                                       G_N_ELEMENTS (ls->st) * 2 * sizeof (guint32));
                        memcpy (new_array, ls->st,  G_N_ELEMENTS (ls->st) * sizeof (guint32));
                        ls->dyn.n = new_array;
                        ls->dyn.e = -1;
index a912fb5b5432f0db423aaf0ec385795840eda167..7e7a2854fe3dc965438d92375f47a4a129a20897 100644 (file)
@@ -1902,7 +1902,7 @@ rspamd_lua_run_config_unload (lua_State *L, struct rspamd_config *cfg)
        struct rspamd_config_cfg_lua_script *sc;
        struct rspamd_config **pcfg;
 
-       LL_FOREACH (cfg->post_init_scripts, sc) {
+       LL_FOREACH (cfg->config_unload_scripts, sc) {
                lua_pushcfunction (L, &rspamd_lua_traceback);
                gint err_idx = lua_gettop (L);