summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-08-22 13:55:54 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-22 10:47:14 -0500
commita7e47d4bfcbf256fae06891a8599950ff8e1b61b (patch)
treecaa5016c7b679a0f8f91cb3d61f4c8fcf27447e1
parent0d07fe47d4986271a21ed4ff5237275ff55dd93f (diff)
downloadfocaccia-qemu-a7e47d4bfcbf256fae06891a8599950ff8e1b61b.tar.gz
focaccia-qemu-a7e47d4bfcbf256fae06891a8599950ff8e1b61b.zip
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>
-rw-r--r--block/sheepdog.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index a04ad99ead..df4f44107b 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -485,6 +485,7 @@ static int connect_to_sdog(const char *addr, const char *port)
             if (errno == EINTR) {
                 goto reconnect;
             }
+            close(fd);
             break;
         }