]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
ivshmem: Fix fd leak on error
authorAndreas Färber <afaerber@suse.de>
Mon, 15 Sep 2014 16:40:08 +0000 (18:40 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Jan 2015 21:43:56 +0000 (15:43 -0600)
Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3a31cff11203bf62ebafa6d74b1fcf2aba345eed)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/misc/ivshmem.c

index c3dc5c31795878002de17384ef1bfc47ba269c34..7252f6481dfdd1a0bd1b3c1fe1cdabec7f572660 100644 (file)
@@ -508,6 +508,7 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
     if (incoming_fd == -1) {
         fprintf(stderr, "could not allocate file descriptor %s\n",
                                                             strerror(errno));
+        close(tmp_fd);
         return;
     }