aboutsummaryrefslogtreecommitdiff
path: root/hw/misc
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2014-09-15 18:40:08 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-31 17:02:14 +0100
commit3a31cff11203bf62ebafa6d74b1fcf2aba345eed (patch)
treef6db25f2720cdf55433af6b27f69a4718f581243 /hw/misc
parent34bc07c5282a631c2663ae1ded0a186f46f64612 (diff)
ivshmem: Fix fd leak on error
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>
Diffstat (limited to 'hw/misc')
-rw-r--r--hw/misc/ivshmem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index ecef82a423..bf585b7691 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;
}