mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 10:31:16 +00:00
Fixed memory corruption after destroying network/domain objects in QEMU driver
This commit is contained in:
parent
f1f70e5099
commit
62efeb0752
@ -1,3 +1,9 @@
|
||||
Fri Jul 6 17:50:00 EST 2007 Daniel P.Berrange <berrange@redhat.com>
|
||||
|
||||
* src/qemu_driver.c: Use virFreeDomain and virFreeNetwork
|
||||
instead of free(), to ensure the objects are removed from
|
||||
the cache
|
||||
|
||||
Fri Jul 6 16:19:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
||||
|
||||
* src/libvirt.c, src/qemu_driver.c: If the virNetworkLookup*
|
||||
|
@ -1903,7 +1903,7 @@ static int qemudDomainDestroy(virDomainPtr dom) {
|
||||
}
|
||||
|
||||
ret = qemudShutdownVMDaemon(driver, vm);
|
||||
free(dom);
|
||||
virFreeDomain(dom->conn, dom);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2332,6 +2332,7 @@ static int qemudNetworkStart(virNetworkPtr net) {
|
||||
static int qemudNetworkDestroy(virNetworkPtr net) {
|
||||
struct qemud_driver *driver = (struct qemud_driver *)net->conn->networkPrivateData;
|
||||
struct qemud_network *network = qemudFindNetworkByUUID(driver, net->uuid);
|
||||
int ret;
|
||||
|
||||
if (!network) {
|
||||
qemudReportError(net->conn, NULL, net, VIR_ERR_INVALID_NETWORK,
|
||||
@ -2339,7 +2340,11 @@ static int qemudNetworkDestroy(virNetworkPtr net) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qemudShutdownNetworkDaemon(driver, network);
|
||||
ret = qemudShutdownNetworkDaemon(driver, network);
|
||||
|
||||
virFreeNetwork(net->conn, net);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *qemudNetworkDumpXML(virNetworkPtr net, int flags ATTRIBUTE_UNUSED) {
|
||||
|
Loading…
Reference in New Issue
Block a user