diff options
author | Mikhail Galanin <mgalanin@mimecast.com> | 2018-09-18 10:20:28 +0100 |
---|---|---|
committer | Mikhail Galanin <mgalanin@mimecast.com> | 2018-09-18 10:20:28 +0100 |
commit | 8b26fafde4f09ada6deec0a550e1bb955e6afe16 (patch) | |
tree | 4d7c9692f6e26013b3afd362977136c6367a0f1a /src/lua/lua_tcp.c | |
parent | 5b571379f3a2493f53eabd331da42ddcdcce4921 (diff) | |
download | rspamd-8b26fafde4f09ada6deec0a550e1bb955e6afe16.tar.gz rspamd-8b26fafde4f09ada6deec0a550e1bb955e6afe16.zip |
[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.
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r-- | src/lua/lua_tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index b5b6eba5f..91cf3726d 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); |