mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
umlAutostartDomain: avoid NULL-deref upon virGetLastError failure
* src/uml/uml_driver.c (umlAutostartDomain): Handle a NULL return from virGetLastError.
This commit is contained in:
parent
6e5b5bbc0a
commit
8e8bda2614
@ -157,7 +157,7 @@ umlAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu
|
|||||||
if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) {
|
if (umlStartVMDaemon(data->conn, data->driver, vm) < 0) {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
|
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
|
||||||
vm->def->name, err->message);
|
vm->def->name, err ? err->message : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virDomainObjUnlock(vm);
|
virDomainObjUnlock(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user