mirror of https://github.com/xemu-project/xemu.git
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>
This commit is contained in:
parent
34bc07c528
commit
3a31cff112
|
@ -512,6 +512,7 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
|
||||||
if (incoming_fd == -1) {
|
if (incoming_fd == -1) {
|
||||||
fprintf(stderr, "could not allocate file descriptor %s\n",
|
fprintf(stderr, "could not allocate file descriptor %s\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
close(tmp_fd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue