From: Vsevolod Stakhov Date: Tue, 3 May 2016 12:16:30 +0000 (+0100) Subject: [Fix] One more fix in redis destructor X-Git-Tag: 1.3.0~568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9282bbd545d1a1978b29a4d63b161cce9ccf8ed;p=thirdparty%2Frspamd.git [Fix] One more fix in redis destructor --- diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index 1eedde277d..55a85d22d9 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -135,6 +135,7 @@ lua_redis_dtor (struct lua_redis_ctx *ctx) { struct lua_redis_userdata *ud; struct lua_redis_specific_userdata *cur, *tmp; + gboolean is_connected = FALSE; if (ctx->async) { ud = &ctx->d.async; @@ -149,10 +150,14 @@ lua_redis_dtor (struct lua_redis_ctx *ctx) ctx->ref.refcount = 100500; redisAsyncFree (ud->ctx); ctx->ref.refcount = 0; + is_connected = TRUE; } LL_FOREACH_SAFE (ud->specific, cur, tmp) { lua_redis_free_args (cur->args, cur->nargs); - event_del (&cur->timeout); + + if (is_connected) { + event_del (&cur->timeout); + } if (cur->cbref != -1) { luaL_unref (ud->L, LUA_REGISTRYINDEX, cur->cbref);