aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libserver/rspamd_control.c1
-rw-r--r--src/libutil/expression.c5
-rw-r--r--src/plugins/fuzzy_check.c6
-rw-r--r--src/rspamd.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c
index 592e3dbc1..c78f501f7 100644
--- a/src/libserver/rspamd_control.c
+++ b/src/libserver/rspamd_control.c
@@ -774,6 +774,7 @@ rspamd_srv_handler (gint fd, short what, gpointer ud)
rdata->rep.id = cmd.id;
rdata->rep.type = cmd.type;
rdata->fd = -1;
+
if (msg.msg_controllen >= CMSG_LEN (sizeof (int))) {
rfd = *(int *) CMSG_DATA(CMSG_FIRSTHDR (&msg));
}
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index adc926e53..a7cc1af80 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -567,6 +567,7 @@ rspamd_parse_expression (const gchar *line, gsize len,
enum rspamd_expression_op op, op_stack;
const gchar *p, *c, *end;
GPtrArray *operand_stack;
+ GNode *tmp;
enum {
PARSE_ATOM = 0,
@@ -859,6 +860,10 @@ rspamd_parse_expression (const gchar *line, gsize len,
return TRUE;
err:
+ while ((tmp = rspamd_expr_stack_elt_pop (operand_stack)) != NULL) {
+ g_node_destroy (tmp);
+ }
+
g_ptr_array_free (operand_stack, TRUE);
rspamd_expression_destroy (e);
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 040219e2a..804db15e6 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -419,12 +419,6 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
}
}
- if (rule->mime_types != NULL) {
- rspamd_mempool_add_destructor (fuzzy_module_ctx->fuzzy_pool,
- (rspamd_mempool_destruct_t)rspamd_ptr_array_free_hard,
- rule->mime_types);
- }
-
if ((value = ucl_object_lookup (obj, "headers")) != NULL) {
it = NULL;
while ((cur = ucl_object_iterate (value, &it, value->type == UCL_ARRAY))
diff --git a/src/rspamd.c b/src/rspamd.c
index 6a9c4f321..877ac00a5 100644
--- a/src/rspamd.c
+++ b/src/rspamd.c
@@ -160,6 +160,7 @@ read_cmd_line (gint *argc, gchar ***argv, struct rspamd_config *cfg)
if (!g_option_context_parse (context, argc, argv, &error)) {
fprintf (stderr, "option parsing failed: %s\n", error->message);
+ g_option_context_free (context);
exit (1);
}
@@ -192,6 +193,7 @@ read_cmd_line (gint *argc, gchar ***argv, struct rspamd_config *cfg)
}
cfg->pid_file = rspamd_pidfile;
+ g_option_context_free (context);
}
/* Detect privilleged mode */