From 3a31cff11203bf62ebafa6d74b1fcf2aba345eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 15 Sep 2014 18:40:08 +0200 Subject: ivshmem: Fix fd leak on error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: Stefan Hajnoczi Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber Reviewed-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/misc') diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index ecef82a..bf585b7 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -512,6 +512,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; } -- cgit v1.1