From 952d2b33662b601d6a0fd972fd3cff3d3efc971e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 29 Apr 2016 14:18:44 +0100 Subject: [PATCH] [Minor] Plug minor memory leak in regexps creation --- src/libmime/mime_expressions.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index c107703a9..a29b52252 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -355,9 +355,13 @@ rspamd_mime_expr_parse_regexp_atom (rspamd_mempool_t * pool, const gchar *line, g_string_free (re_flags, TRUE); if (result->regexp == NULL || err != NULL) { - msg_warn_pool ("could not read regexp: %s while reading regexp %s", - err ? err->message : "unknown error", - src); + msg_warn_pool ("could not read regexp: %s while reading regexp %e", + err, src); + + if (err) { + g_error_free (err); + } + return NULL; } -- 2.39.5