aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-03 16:24:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-03 16:24:15 +0100
commit813f1f407f639c1f025298abae9fd0295a30d24c (patch)
tree97d62a546789698af9be1d4b6aac1183e4f9efd2 /src/plugins/regexp.c
parentf2c442c62951e1441493797268bb36f5da635ee4 (diff)
downloadrspamd-813f1f407f639c1f025298abae9fd0295a30d24c.tar.gz
rspamd-813f1f407f639c1f025298abae9fd0295a30d24c.zip
Fix some warnings that actually are dangerous.
Diffstat (limited to 'src/plugins/regexp.c')
-rw-r--r--src/plugins/regexp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 272805548..91543d2c4 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -1151,7 +1151,8 @@ optimize_regexp_expression (struct expression **e, GQueue * stack, gboolean res)
}
static gboolean
-process_regexp_expression (struct expression *expr, gchar *symbol, struct worker_task *task, const gchar *additional, struct lua_locked_state *nL)
+process_regexp_expression (struct expression *expr, gchar *symbol, struct worker_task *task,
+ const gchar *additional, struct lua_locked_state *nL)
{
GQueue *stack;
gsize cur, op1, op2;
@@ -1192,15 +1193,13 @@ process_regexp_expression (struct expression *expr, gchar *symbol, struct worker
}
else if (it->type == EXPR_STR) {
/* This may be lua function, try to call it */
- if (regexp_module_ctx->workers != NULL) {
- if (nL) {
- rspamd_mutex_lock (nL->m);
- cur = maybe_call_lua_function ((const gchar*)it->content.operand, task, nL->L);
- rspamd_mutex_unlock (nL->m);
- }
- else {
- cur = maybe_call_lua_function ((const gchar*)it->content.operand, task, task->cfg->lua_state);
- }
+ if (nL) {
+ rspamd_mutex_lock (nL->m);
+ cur = maybe_call_lua_function ((const gchar*)it->content.operand, task, nL->L);
+ rspamd_mutex_unlock (nL->m);
+ }
+ else {
+ cur = maybe_call_lua_function ((const gchar*)it->content.operand, task, task->cfg->lua_state);
}
debug_task ("function %s returned %s", (const gchar *)it->content.operand, cur ? "true" : "false");
if (try_optimize) {