]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Plug minor memory leak in regexps creation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Apr 2016 13:18:44 +0000 (14:18 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 29 Apr 2016 13:18:44 +0000 (14:18 +0100)
src/libmime/mime_expressions.c

index c73b1c17c8467fed66384e50bbb283f363a93967..9b99ed66764d190c0e35b6f2ab34d605cf864562 100644 (file)
@@ -356,9 +356,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;
        }