From: Mikhail Galanin Date: Tue, 18 Sep 2018 09:20:28 +0000 (+0100) Subject: [Minor] Fixed error reported by ASAN: do not try usins already pop-ed watcher X-Git-Tag: 1.8.0~83^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2491%2Fhead;p=thirdparty%2Frspamd.git [Minor] Fixed error reported by ASAN: do not try usins already pop-ed watcher The watcher is pop-ed once session is over but reference to the structure remains in Lua and then being removed from lua dtor. In this case we try to pop it second time. Bad. --- diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index b5b6eba5f9..91cf3726dd 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -485,6 +485,7 @@ lua_tcp_maybe_free (struct lua_tcp_cbdata *cbd) if (cbd->w) { rspamd_session_watcher_pop (cbd->session, cbd->w); } + cbd->w = NULL; if (cbd->async_ev) { rspamd_session_remove_event (cbd->session, lua_tcp_void_finalyser, cbd); @@ -496,6 +497,7 @@ lua_tcp_maybe_free (struct lua_tcp_cbdata *cbd) if (cbd->w) { rspamd_session_watcher_pop (cbd->session, cbd->w); } + cbd->w = NULL; if (cbd->async_ev) { rspamd_session_remove_event (cbd->session, lua_tcp_fin, cbd);