qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard
PATCH 1/1 qcow2: fix leak of Qcow2DiscardRegion in update_refcount_discard
When the Qcow2DiscardRegion is adjacent to another one referenced by "d", free this Qcow2DiscardRegion metadata referenced by "p" after it was removed from s->discards queue.
Signed-off-by Zhang Haoyu <[email protected]>
--- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+)
block/qcow2-refcount.c +1 -0
@@ -524,6 +524,7 @@ found:QTAILQ_REMOVE (&s->discards, p, next); d->offset =MIN (d->offset, p->offset); d->bytes += p->bytes; +g_free (p); } }
Signature · 1 line
1.7.12.4
Am 11.10.2014 um 10:35 schrieb Zhang Haoyu:
Quoted 8 lines
When the Qcow2DiscardRegion is adjacent to another one referenced by "d", free this Qcow2DiscardRegion metadata referenced by "p" after it was removed from
s->discardsqueue.Signed-off-by Zhang Haoyu <[email protected]>--- block/qcow2-refcount.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by Max Reitz <[email protected]>