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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux