From: Mikhail Galanin Date: Thu, 30 Aug 2018 09:54:16 +0000 (+0100) Subject: [Minor] cbref is initilised with -1 by default X-Git-Tag: 1.8.0~196^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2449%2Fhead;p=thirdparty%2Frspamd.git [Minor] cbref is initilised with -1 by default --- diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 61a73acf85..ce91d78735 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -249,7 +249,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd) } if (hdl->type == LUA_WANT_READ) { - if (hdl->h.r.cbref) { + if (hdl->h.r.cbref && hdl->h.r.cbref != -1) { luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.r.cbref); } @@ -258,7 +258,7 @@ lua_tcp_shift_handler (struct lua_tcp_cbdata *cbd) } } else { - if (hdl->h.w.cbref) { + if (hdl->h.w.cbref && hdl->h.w.cbref != -1) { luaL_unref (cbd->task->cfg->lua_state, LUA_REGISTRYINDEX, hdl->h.w.cbref); }