]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix use after free
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Sep 2021 18:22:26 +0000 (19:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Sep 2021 18:22:26 +0000 (19:22 +0100)
Reported by: @citrin

src/libserver/re_cache.c

index 631981b30d62cbb20992f7ae7ef202faeca339e1..4d631da0111cb915e11575bdcbf8ee0329e15946 100644 (file)
@@ -2065,15 +2065,15 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
                                g_free (hs_pats[j]);
                        }
 
+                       err = g_error_new (rspamd_re_cache_quark (), EINVAL,
+                                       "cannot create tree of regexp when processing '%s': %s",
+                                       hs_pats[hs_errors->expression], hs_errors->message);
                        g_free (hs_pats);
                        g_free (hs_exts);
                        close (fd);
                        unlink (path);
                        hs_free_compile_error (hs_errors);
 
-                       err = g_error_new (rspamd_re_cache_quark (), EINVAL,
-                                       "cannot create tree of regexp when processing '%s': %s",
-                                       hs_pats[hs_errors->expression], hs_errors->message);
                        rspamd_re_cache_compile_err (EV_A_ w, err, cbdata);
 
                        return;