From patchwork Fri Jan 18 16:28:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5/8] win32-aio: Fix memory leak Date: Fri, 18 Jan 2013 06:28:38 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 213677 Message-Id: <1358526521-24300-6-git-send-email-stefanha@redhat.com> To: Cc: Kevin Wolf , Anthony Liguori , qemu-stable@nongnu.org, Stefan Hajnoczi From: Kevin Wolf 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 Signed-off-by: Stefan Hajnoczi --- block/win32-aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/win32-aio.c b/block/win32-aio.c index e4b7b75..b9236ea 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; } - qemu_vfree(waiocb->buf); } + qemu_vfree(waiocb->buf); }