From 36a9802c54a8a18c6130f220a32ee21952fee387 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Mon, 27 Jul 2015 23:35:02 +0200 Subject: Prevent crash on pending replies in async code Fixes #335. --- async.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/async.c b/async.c index 28aa76f..acca29a 100644 --- a/async.c +++ b/async.c @@ -418,7 +418,8 @@ void redisProcessCallbacks(redisAsyncContext *ac) { if (reply == NULL) { /* When the connection is being disconnected and there are * no more replies, this is the cue to really disconnect. */ - if (c->flags & REDIS_DISCONNECTING && sdslen(c->obuf) == 0) { + if (c->flags & REDIS_DISCONNECTING && sdslen(c->obuf) == 0 + && ac->replies.head == NULL) { __redisAsyncDisconnect(ac); return; } -- cgit v1.2.3