diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2010-04-21 20:35:45 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-04-23 16:21:58 +0200 |
commit | 3544cb472e8d3592d18fb9e191d92e77cc455d9b (patch) | |
tree | b0a57c1b1760bc6599dfbbb78ce72f28d672d755 | |
parent | ebda2e72863482764b35fa24c9f7a21ac6832f0c (diff) | |
download | qemu-3544cb472e8d3592d18fb9e191d92e77cc455d9b.tar.gz qemu-3544cb472e8d3592d18fb9e191d92e77cc455d9b.tar.bz2 qemu-3544cb472e8d3592d18fb9e191d92e77cc455d9b.zip |
block: Free iovec arrays allocated by multiwrite_merge()
A new iovec array is allocated when creating a merged write request.
This patch ensures that the iovec array is deleted in addition to its
qiov owner.
Reported-by: Leszek Urbanski <tygrys@moo.pl>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1739,6 +1739,9 @@ static void multiwrite_user_cb(MultiwriteCB *mcb) for (i = 0; i < mcb->num_callbacks; i++) { mcb->callbacks[i].cb(mcb->callbacks[i].opaque, mcb->error); + if (mcb->callbacks[i].free_qiov) { + qemu_iovec_destroy(mcb->callbacks[i].free_qiov); + } qemu_free(mcb->callbacks[i].free_qiov); qemu_vfree(mcb->callbacks[i].free_buf); } |