mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
openvz: Need to check 'vm' first before dereferencing 'def'
This commit is contained in:
parent
3f9d6c3566
commit
a75d762fcd
@ -2053,13 +2053,13 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|||||||
|
|
||||||
openvzDriverLock(driver);
|
openvzDriverLock(driver);
|
||||||
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
||||||
vmdef = vm->def;
|
|
||||||
|
|
||||||
if (!vm) {
|
if (!vm) {
|
||||||
virReportError(VIR_ERR_NO_DOMAIN, "%s",
|
virReportError(VIR_ERR_NO_DOMAIN, "%s",
|
||||||
_("no domain with matching uuid"));
|
_("no domain with matching uuid"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
vmdef = vm->def;
|
||||||
|
|
||||||
if (virStrToLong_i(vmdef->name, NULL, 10, &veid) < 0) {
|
if (virStrToLong_i(vmdef->name, NULL, 10, &veid) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user