From b50f2ba86c0d4173b7f8d179ae5177eb8379451a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 22 Apr 2015 19:00:57 +1000 Subject: [PATCH] Check clients match in epoll loop --- src/connector.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index d3f68ac8..60354661 100644 --- a/src/connector.c +++ b/src/connector.c @@ -492,8 +492,7 @@ void *receiver(void *arg) client = event.data.ptr; /* Recheck this client still exists in the same form when it * was queued. */ - client = ref_client_by_id(cdata, client->id); - if (unlikely(!client)) + if (unlikely(client != ref_client_by_id(cdata, client->id))) continue; if (event.events & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) { /* Client disconnected */