]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
sheepdog: don't leak socket file descriptor upon connection failure
authorJim Meyering <meyering@redhat.com>
Wed, 22 Aug 2012 11:55:54 +0000 (13:55 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Aug 2012 06:50:02 +0000 (01:50 -0500)
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>
block/sheepdog.c

index f46ca8fb694a8de4204b6df2b515cd87abff3b3a..36ff9d7482daf142c5df8481a47d20aabb1db1f9 100644 (file)
@@ -489,6 +489,7 @@ static int connect_to_sdog(const char *addr, const char *port)
             if (errno == EINTR) {
                 goto reconnect;
             }
+            close(fd);
             break;
         }