mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
domain_conf: Fix memory leak when free'ing virDomainObj
Free dom->deprecations when free'ing virDomainObj Signed-off-by: Luke Yue <lukedyue@gmail.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
b160cb7201
commit
5de700c64f
@ -3730,6 +3730,16 @@ void virDomainDefFree(virDomainDef *def)
|
||||
g_free(def);
|
||||
}
|
||||
|
||||
static void
|
||||
virDomainObjDeprecationFree(virDomainObj *dom)
|
||||
{
|
||||
size_t i = 0;
|
||||
for (i = 0; i < dom->ndeprecations; i++) {
|
||||
g_free(dom->deprecations[i]);
|
||||
}
|
||||
g_free(dom->deprecations);
|
||||
}
|
||||
|
||||
static void virDomainObjDispose(void *obj)
|
||||
{
|
||||
virDomainObj *dom = obj;
|
||||
@ -3742,6 +3752,7 @@ static void virDomainObjDispose(void *obj)
|
||||
if (dom->privateDataFreeFunc)
|
||||
(dom->privateDataFreeFunc)(dom->privateData);
|
||||
|
||||
virDomainObjDeprecationFree(dom);
|
||||
virDomainSnapshotObjListFree(dom->snapshots);
|
||||
virDomainCheckpointObjListFree(dom->checkpoints);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user