From: Andreas Färber Date: Mon, 15 Sep 2014 16:40:08 +0000 (+0200) Subject: ivshmem: Fix fd leak on error X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~209^2~494^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a31cff11203bf62ebafa6d74b1fcf2aba345eed;p=sdk%2Femulator%2Fqemu.git ivshmem: Fix fd leak on error 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 --- 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; }