]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix use-after-free
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Oct 2019 13:34:03 +0000 (14:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Oct 2019 13:34:03 +0000 (14:34 +0100)
src/rspamadm/rspamadm.c

index 2487207ef2f94545a3aa96c644396f9b151a72dd..661b468afd0635bd859319ca1cd3346aceeaa98e 100644 (file)
@@ -438,8 +438,6 @@ main (gint argc, gchar **argv, gchar **env)
                exit (1);
        }
 
-       g_option_context_free (context);
-
        /* Setup logger */
        if (verbose) {
                cfg->log_level = G_LOG_LEVEL_DEBUG;
@@ -614,6 +612,7 @@ main (gint argc, gchar **argv, gchar **env)
        ev_break (rspamd_main->event_loop, EVBREAK_ALL);
 
 end:
+       g_option_context_free (context);
        rspamd_dns_resolver_deinit (resolver);
        REF_RELEASE (rspamd_main->cfg);
        rspamd_http_context_free (rspamd_main->http_ctx);