[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 50/93] drive mirror:fix memory leak
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 50/93] drive mirror:fix memory leak |
Date: |
Fri, 24 Jan 2014 18:21:33 +0100 |
From: Zhang Min <address@hidden>
In the function mirror_iteration() -> qemu_iovec_init(),
it allocates memory for op->qiov.iov, when the write request calls back,
but in the function mirror_iteration_done(), it only frees the op,
not free the op->qiov.iov, so this causes memory leak.
It should use qemu_iovec_destroy() to free op->qiov.
Signed-off-by: Zhang Min <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/mirror.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/mirror.c b/block/mirror.c
index 2932bab..05758e5 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -96,6 +96,7 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
bitmap_set(s->cow_bitmap, chunk_num, nb_chunks);
}
+ qemu_iovec_destroy(&op->qiov);
g_slice_free(MirrorOp, op);
qemu_coroutine_enter(s->common.co, NULL);
}
--
1.8.1.4
- [Qemu-devel] [PULL 41/93] iotests: Test file format nesting, (continued)
- [Qemu-devel] [PULL 41/93] iotests: Test file format nesting, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 42/93] block: fix backing file segfault, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 43/93] dataplane: fix shadowed return value, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 44/93] qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 45/93] vmdk: Check for overhead when opening, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 46/93] qemu-progress: Drop unused include, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 47/93] qemu-progress: Fix progress printing on SIGUSR1, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 49/93] sheepdog: fix 'qemu-img map', Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 48/93] Documentation: qemu-img: Mention SIGUSR1 progress report, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 51/93] vmdk: Fix format specific information (create type) for streamOptimized, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 50/93] drive mirror:fix memory leak,
Kevin Wolf <=
- [Qemu-devel] [PULL 52/93] qapi: Add "backing" to BlockStats, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 54/93] block: Allow the user to define "node-name" option both on command line and QMP., Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 53/93] block: Add bs->node_name to hold the name of a bs node of the bs graph., Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 61/93] block: resize backing file image during offline commit, if necessary, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 62/93] block: resize backing image during active layer commit, if needed, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 64/93] block: Fix bdrv_commit return value, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 63/93] block: update block commit documentation regarding image truncation, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 65/93] block: Move initialisation of BlockLimits to bdrv_refresh_limits(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 66/93] block: Inherit opt_transfer_length, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 68/93] qemu_memalign: Allow small alignments, Kevin Wolf, 2014/01/24