[sheepdog] [PATCH] bs_sheepdog.c: fix a descriptor leak in connect_to_sdog_tcp()

Ryusuke Konishi konishi.ryusuke at lab.ntt.co.jp
Mon Dec 16 16:52:45 CET 2013


When connect_to_sdoc_tcp function failed to connect a socket due to an
error other than EINTR, it doesn't free the socket file descriptor.

This fixes the leak bug.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke at lab.ntt.co.jp>
---
 usr/bs_sheepdog.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
index 3edc720..07ad0de 100644
--- a/usr/bs_sheepdog.c
+++ b/usr/bs_sheepdog.c
@@ -372,6 +372,7 @@ reconnect:
 			if (errno == EINTR)
 				goto reconnect;
 
+			close(fd);
 			break;
 		}
 
-- 
1.7.9.3




More information about the sheepdog mailing list