]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Cleanup memory on the error path
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 12:55:09 +0000 (12:55 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 20 Mar 2022 12:55:09 +0000 (12:55 +0000)
src/libmime/mime_expressions.c

index 9d1362e287d5de193b196afd699aba09135e6b8f..d3d40c8708491e8f5f61b91e492a971d7c02156b 100644 (file)
@@ -827,6 +827,7 @@ set:
                                                g_set_error (err, rspamd_mime_expr_quark (), 320,
                                                                "re_conditions is not a table for '%s'",
                                                                mime_atom->str);
+                                               rspamd_regexp_unref (mime_atom->d.re->regexp);
                                                goto err;
                                        }
 
@@ -838,6 +839,7 @@ set:
                                                        g_set_error (err, rspamd_mime_expr_quark (), 320,
                                                                        "condition for '%s' is invalid, must be function",
                                                                        mime_atom->str);
+                                                       rspamd_regexp_unref (mime_atom->d.re->regexp);
                                                        goto err;
                                                }