diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-02 16:53:04 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-10-02 16:53:04 +0400 |
commit | e6a1d22de250c10992b484635fd95a03f197f779 (patch) | |
tree | 8880907edbd20d3fd974af4fcf25960ad18d73a5 /src/plugins | |
parent | 032b6404155a362d7d5172dd7f1e3688dda6bf25 (diff) | |
download | rspamd-e6a1d22de250c10992b484635fd95a03f197f779.tar.gz rspamd-e6a1d22de250c10992b484635fd95a03f197f779.zip |
* Fix some memory issues with lua (strings that are returned from lua can be freed early)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/received_rbl.lua | 6 | ||||
-rw-r--r-- | src/plugins/regexp.c | 2 | ||||
-rw-r--r-- | src/plugins/surbl.c | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/lua/received_rbl.lua b/src/plugins/lua/received_rbl.lua index bee027f50..fa29cabc8 100644 --- a/src/plugins/lua/received_rbl.lua +++ b/src/plugins/lua/received_rbl.lua @@ -8,9 +8,9 @@ -- }; -metric = 'default' -symbol = 'RECEIVED_RBL' -rbls = {} +local metric = 'default' +local symbol = 'RECEIVED_RBL' +local rbls = {} function dns_cb(task, to_resolve, results, err) if results then diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index d8d9f3ea8..ec07bc0ad 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -544,6 +544,7 @@ process_regexp_expression (struct expression *expr, char *symbol, struct worker_ re = parse_regexp (task->cfg->cfg_pool, it->content.operand, task->cfg->raw_mode); if (re == NULL) { msg_warn ("process_regexp_expression: cannot parse regexp, skip expression"); + g_queue_free (stack); return FALSE; } it->content.operand = re; @@ -586,6 +587,7 @@ process_regexp_expression (struct expression *expr, char *symbol, struct worker_ if (!g_queue_is_empty (stack)) { op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); if (op1) { + g_queue_free (stack); return TRUE; } } diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 75d0f0f3b..61f70586e 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -346,6 +346,7 @@ format_surbl_request (memory_pool_t *pool, f_str_t *hostname, struct suffix_item g_match_info_free (info); return result; } + g_match_info_free (info); } /* Try to match normal domain */ if (g_regex_match_full (surbl_module_ctx->extract_normal_regexp, hostname->begin, hostname->len, 0, 0, &info, NULL) == TRUE) { |