mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
qemu: avoid null deref on low memory
Detected by Coverity. qemuDomainEventQueue requires a non-NULL pointer; most callers silently drop the event if we encountered and OOM situation trying to create the event. * src/qemu/qemu_migration.c (qemuMigrationFinish): Check for OOM.
This commit is contained in:
parent
3f81f8e4c1
commit
74d224fac3
@ -2552,7 +2552,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
|
||||
VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
|
||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
|
||||
qemuDomainEventQueue(driver, event);
|
||||
if (event)
|
||||
qemuDomainEventQueue(driver, event);
|
||||
event = virDomainEventNewFromObj(vm,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED,
|
||||
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
|
||||
|
Loading…
Reference in New Issue
Block a user