mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: eliminate memory leak in qemuDomainUpdateDeviceConfig
This function was freeing a virDomainNetDef with VIR_FREE(). virDomainNetDef is a complex structure with many pointers to other dynamically allocated data; to properly free it virDomainNetDefFree() must be called instead, otherwise several strings (and potentially other things) will be leaked.
This commit is contained in:
parent
edb6fc3a7f
commit
7a23ba090d
@ -5570,7 +5570,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(vmdef->nets[pos]);
|
virDomainNetDefFree(vmdef->nets[pos]);
|
||||||
|
|
||||||
vmdef->nets[pos] = net;
|
vmdef->nets[pos] = net;
|
||||||
dev->data.net = NULL;
|
dev->data.net = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user