[Sheepdog] [PATCH] sheep: fix a memory leak

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Sep 17 10:14:54 CEST 2011


If a connection is closed before finishing sending data,
free_request() is not called against it.

This patch triggers client_tx_handler() even if the connection is
closed, and calls free_request() in it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/sdnet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 6d34c2b..ae4a5fc 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -556,7 +556,7 @@ static void client_handler(int fd, int events, void *data)
 	if (events & EPOLLIN)
 		client_rx_handler(ci);
 
-	if (!is_conn_dead(&ci->conn) && events & EPOLLOUT)
+	if (events & EPOLLOUT)
 		client_tx_handler(ci);
 
 	if (is_conn_dead(&ci->conn)) {
-- 
1.7.2.5




More information about the sheepdog mailing list