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:
Laine Stump 2012-03-08 01:46:36 -05:00
parent edb6fc3a7f
commit 7a23ba090d

View File

@ -5570,7 +5570,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
return -1;
}
VIR_FREE(vmdef->nets[pos]);
virDomainNetDefFree(vmdef->nets[pos]);
vmdef->nets[pos] = net;
dev->data.net = NULL;