diff options
author | Andreas Färber <afaerber@suse.de> | 2014-09-15 18:40:08 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-31 17:02:14 +0100 |
commit | 3a31cff11203bf62ebafa6d74b1fcf2aba345eed (patch) | |
tree | f6db25f2720cdf55433af6b27f69a4718f581243 | |
parent | 34bc07c5282a631c2663ae1ded0a186f46f64612 (diff) | |
download | hqemu-3a31cff11203bf62ebafa6d74b1fcf2aba345eed.zip hqemu-3a31cff11203bf62ebafa6d74b1fcf2aba345eed.tar.gz |
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>
-rw-r--r-- | hw/misc/ivshmem.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |