summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2010-04-21 20:35:45 +0100
committerKevin Wolf <kwolf@redhat.com>2010-04-23 16:21:58 +0200
commit3544cb472e8d3592d18fb9e191d92e77cc455d9b (patch)
treeb0a57c1b1760bc6599dfbbb78ce72f28d672d755
parentebda2e72863482764b35fa24c9f7a21ac6832f0c (diff)
downloadqemu-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block.c b/block.c
index 12cf434afe..7974215ea4 100644
--- a/block.c
+++ b/block.c
@@ -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);
}