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: https://source.dussan.org/?a=commitdiff_plain;h=9059c3b6cdf53b7eb4ea5aae201970a679062ca0;p=rspamd.git [Minor] cbref is initilised with -1 by default --- diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 61a73acf8..ce91d7873 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); }