From 95d1236b8c7398bd8ba6f5e58e78bea96f1651ef Mon Sep 17 00:00:00 2001 From: Christian von Arnim Date: Thu, 21 Feb 2019 17:33:59 +0100 Subject: [PATCH] Fix crash when subscribed connections are closed #155 --- client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 4543cff..be52616 100644 --- a/client.c +++ b/client.c @@ -291,7 +291,8 @@ http_client_read(struct http_client *c) { /* disconnect from all channels */ redisAsyncDisconnect(c->pub_sub->ac); - if(c->pub_sub) c->pub_sub->ac = NULL; + // c->pub_sub might be already cleared by an event handler in redisAsyncDisconnect + cmd->ac = NULL; c->pub_sub = NULL; /* delete command object */