From: Vsevolod Stakhov Date: Wed, 23 Aug 2017 19:20:35 +0000 (+0100) Subject: [Minor] Fix use after free X-Git-Tag: 1.7.0~705 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=233a082b420a8b8bb41fe8a8017d91e48ade40e9;p=rspamd.git [Minor] Fix use after free --- diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index baab27226..2aed2f7a9 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -1490,8 +1490,6 @@ rspamd_lua_cld_handler (struct rspamd_worker_signal_handler *sigh, void *ud) g_string_free (cbdata->out_buf, TRUE); } - g_free (cbdata); - /* Notify main */ memset (&srv_cmd, 0, sizeof (srv_cmd)); srv_cmd.type = RSPAMD_SRV_ON_FORK; @@ -1500,6 +1498,7 @@ rspamd_lua_cld_handler (struct rspamd_worker_signal_handler *sigh, void *ud) srv_cmd.cmd.on_fork.ppid = getpid (); rspamd_srv_send_command (cbdata->wrk, cbdata->ev_base, &srv_cmd, -1, NULL, NULL); + g_free (cbdata); /* We are done with this SIGCHLD */ return FALSE;