diff --git a/src/networking.cpp b/src/networking.cpp index 58bd79bcc..f6425af60 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -1630,10 +1630,13 @@ void sendReplyToClient(aeEventLoop *el, int fd, void *privdata, int mask) { if (writeToClient(fd,c,1) == C_ERR) { AeLocker ae; - c->lock.lock(); + c->lock(); ae.arm(c); if (c->flags & CLIENT_CLOSE_ASAP) - freeClient(c); + { + if (!freeClient(c)) + c->unlock(); + } } }