From 5dd1169ec0839572a902c846519fd7488f5ea86c Mon Sep 17 00:00:00 2001 From: Alexander Dzyuba Date: Fri, 1 Sep 2023 09:56:48 +0300 Subject: [PATCH] Fixed crash when Fixed crash when __redisAsyncFree is called if redisLibuvAttach has not completed --- adapters/libuv.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapters/libuv.h b/adapters/libuv.h index 268edab79..f0d706367 100644 --- a/adapters/libuv.h +++ b/adapters/libuv.h @@ -130,6 +130,9 @@ static void redisLibuvSetTimeout(void *privdata, struct timeval tv) { static void redisLibuvCleanup(void *privdata) { redisLibuvEvents* p = (redisLibuvEvents*)privdata; + if (p == NULL) + return; + p->context = NULL; // indicate that context might no longer exist if (p->timer.data) { uv_close((uv_handle_t*)&p->timer, on_timer_close);