summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_cfg_file.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 11:32:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-30 11:32:07 +0100
commitff463c609bd364a8090d89a52c4878fa1aef93bd (patch)
tree5ef217f37e5f082b1c3aa7537879f586465dec7a /src/lua/lua_cfg_file.c
parent56583a05d4f391afc3a7bb1551be9724a6d7ba72 (diff)
downloadrspamd-ff463c609bd364a8090d89a52c4878fa1aef93bd.tar.gz
rspamd-ff463c609bd364a8090d89a52c4878fa1aef93bd.zip
Fix couple of compiler warnings
Diffstat (limited to 'src/lua/lua_cfg_file.c')
-rw-r--r--src/lua/lua_cfg_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c
index 0a63164f5..9df0a02ce 100644
--- a/src/lua/lua_cfg_file.c
+++ b/src/lua/lua_cfg_file.c
@@ -40,7 +40,7 @@ lua_process_metric (lua_State *L, const gchar *name, struct rspamd_config *cfg)
{
GList *metric_list;
gchar *symbol;
- const gchar *desc;
+ const gchar *desc = NULL;
struct metric *metric;
gdouble *score;
struct rspamd_symbol_def *s;
@@ -74,7 +74,6 @@ lua_process_metric (lua_State *L, const gchar *name, struct rspamd_config *cfg)
lua_gettable (L, -2);
if (lua_isstring (L, -1)) {
desc = lua_tostring (L, -1);
- s->description = rspamd_mempool_strdup (cfg->cfg_pool, desc);
}
lua_pop (L, 1);
}
@@ -103,6 +102,10 @@ lua_process_metric (lua_State *L, const gchar *name, struct rspamd_config *cfg)
g_hash_table_insert (metric->symbols, symbol, s);
}
+ if (desc) {
+ s->description = rspamd_mempool_strdup (cfg->cfg_pool, desc);
+ }
+
if ((metric_list =
g_hash_table_lookup (cfg->metrics_symbols, symbol)) == NULL) {
metric_list = g_list_prepend (NULL, metric);