summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-01-16 21:20:00 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-01-21 13:43:10 -0600
commit563068a8b2e980713e056512bcd941237f6090fb (patch)
treebe4e539268696c37d58b060e1f38ea22a8a0cde2
parentcdb483457cdbd6012e336e40c12b4ace4f6f2a2f (diff)
downloadqemu-563068a8b2e980713e056512bcd941237f6090fb.tar.gz
win32-aio: Fix memory leak
The buffer is allocated for both reads and writes, and obviously it should be freed even if an error occurs. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit e8bccad5ac6095b5af7946cd72d9aacb57f7c0a3) Conflicts: block/win32-aio.c *addressed conflict due to buggy g_free() still in use instead of qemu_vfree() as it is upstream (via commit 7479acdb) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--block/win32-aio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/win32-aio.c b/block/win32-aio.c
index 6b02707254..9b79633e6e 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -87,8 +87,8 @@ static void win32_aio_process_completion(QEMUWin32AIOState *s,
memcpy(qiov->iov[i].iov_base, p, qiov->iov[i].iov_len);
p += qiov->iov[i].iov_len;
}
- g_free(waiocb->buf);
}
+ qemu_vfree(waiocb->buf);
}