aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-08-22 13:55:54 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-08-28 01:50:02 -0500
commitb68e45c68667dce43341c94c69126852496ddbaf (patch)
tree2b7c160df58f71c570fdcb86d1586bfd8ee5e745
parentdf60f451b3eb94305e63f0bb12c9c361a721bc81 (diff)
sheepdog: don't leak socket file descriptor upon connection failure
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit a7e47d4bfcbf256fae06891a8599950ff8e1b61b) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--block/sheepdog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index f46ca8fb6..36ff9d748 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -489,6 +489,7 @@ static int connect_to_sdog(const char *addr, const char *port)
if (errno == EINTR) {
goto reconnect;
}
+ close(fd);
break;
}