mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-13 00:46:03 -06:00
Fix net/disk hot-unplug segfault
When we hot-unplug the last device, we're currently double-freeing the device definition. Reported by Martin Banas here: https://bugzilla.redhat.com/523953 * src/qemu_driver.c: fix double free
This commit is contained in:
parent
3c80fac258
commit
8881ae1bf8
@ -5998,7 +5998,7 @@ try_command:
|
||||
/* ignore, harmless */
|
||||
}
|
||||
} else {
|
||||
VIR_FREE(vm->def->disks[0]);
|
||||
VIR_FREE(vm->def->disks);
|
||||
vm->def->ndisks = 0;
|
||||
}
|
||||
virDomainDiskDefFree(detach);
|
||||
@ -6100,7 +6100,7 @@ qemudDomainDetachNetDevice(virConnectPtr conn,
|
||||
/* ignore, harmless */
|
||||
}
|
||||
} else {
|
||||
VIR_FREE(vm->def->nets[0]);
|
||||
VIR_FREE(vm->def->nets);
|
||||
vm->def->nnets = 0;
|
||||
}
|
||||
virDomainNetDefFree(detach);
|
||||
|
Loading…
Reference in New Issue
Block a user