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 | 1e1ea48d42e011b9bdd0d689d184e7cac4617b66 (patch) | |
tree | b0a57c1b1760bc6599dfbbb78ce72f28d672d755 /block.c | |
parent | d4c146f0da2ace38b1a0e9ba42374901198909cf (diff) |
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>
Diffstat (limited to 'block.c')
-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); } |