From 9059c3b6cdf53b7eb4ea5aae201970a679062ca0 Mon Sep 17 00:00:00 2001 From: Mikhail Galanin Date: Thu, 30 Aug 2018 10:54:16 +0100 Subject: [PATCH] [Minor] cbref is initilised with -1 by default --- src/lua/lua_tcp.c | 4 ++-- 1 file 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); } -- 2.39.5