aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_tcp.c
diff options
context:
space:
mode:
authorMikhail Galanin <mgalanin@mimecast.com>2018-08-30 10:54:16 +0100
committerMikhail Galanin <mgalanin@mimecast.com>2018-08-30 10:54:16 +0100
commit9059c3b6cdf53b7eb4ea5aae201970a679062ca0 (patch)
tree64b5698fe4632210fcd7ef793051a97250a1430f /src/lua/lua_tcp.c
parent112ed7966d7fcaf7f0a16a79b0af51e7d339e744 (diff)
downloadrspamd-9059c3b6cdf53b7eb4ea5aae201970a679062ca0.tar.gz
rspamd-9059c3b6cdf53b7eb4ea5aae201970a679062ca0.zip
[Minor] cbref is initilised with -1 by default
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r--src/lua/lua_tcp.c4
1 files changed, 2 insertions, 2 deletions
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);
}