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.
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);
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);