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>
This commit is contained in:
parent
d4c146f0da
commit
1e1ea48d42
3
block.c
3
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user