mirror of https://gitee.com/openkylin/qemu.git
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 <zhanghy@sangfor.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
5f77ef69a1
commit
d8bb71b622
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue