From: Stefan Hajnoczi Date: Wed, 21 Apr 2010 19:35:45 +0000 (+0100) Subject: block: Free iovec arrays allocated by multiwrite_merge() X-Git-Tag: v0.12.4~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=012d4869c1eb195e83f159ed7b2bced33f37f960;p=thirdparty%2Fqemu.git 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 Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 1e1ea48d42e011b9bdd0d689d184e7cac4617b66) --- diff --git a/block.c b/block.c index 4f9a48b71a6..7326bfeee3c 100644 --- a/block.c +++ b/block.c @@ -1608,6 +1608,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); }