Patchwork [14/15] win32-aio: Fix how win32_aio_process_completion() frees buffer

login
register
mail settings
Submitter Stefan Hajnoczi
Date Jan. 15, 2013, 4:48 p.m.
Message ID <1358268511-27061-15-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/212260/
State New
Headers show

Comments

Stefan Hajnoczi - Jan. 15, 2013, 4:48 p.m.
From: Markus Armbruster <armbru@redhat.com>

win32_aio_submit() allocates it with qemu_blockalign(), therefore it
must be freed with qemu_vfree(), not g_free().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/win32-aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/block/win32-aio.c b/block/win32-aio.c
index 46a5db7..0383370 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -87,7 +87,7 @@  static void win32_aio_process_completion(QEMUWin32AIOState *s,
                 memcpy(p, qiov->iov[i].iov_base, qiov->iov[i].iov_len);
                 p += qiov->iov[i].iov_len;
             }
-            g_free(waiocb->buf);
+            qemu_vfree(waiocb->buf);
         }
     }