diff options
author | Jan-Erik Rediger <janerik@fnordig.de> | 2015-07-27 23:35:02 +0200 |
---|---|---|
committer | Jan-Erik Rediger <janerik@fnordig.de> | 2015-07-27 23:35:02 +0200 |
commit | 36a9802c54a8a18c6130f220a32ee21952fee387 (patch) | |
tree | 4f5bdf3eed7ac5a186bc75a5de93d14e38f3259e | |
parent | ded537476390e09cf426eabeeaeb2bb84e410f0c (diff) |
Prevent crash on pending replies in async code
Fixes #335.
-rw-r--r-- | async.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |