mirror of https://gitee.com/openkylin/libvirt.git
vmware: Avoid NULL dereference for 'caps'
When virCapabilitiesNew() fails, caps will be NULL resulting in possible core when deref'd in cpuDataFree() call.
This commit is contained in:
parent
f36d83c441
commit
185478af09
|
@ -127,7 +127,8 @@ vmwareCapsInit(void)
|
|||
|
||||
cleanup:
|
||||
virCPUDefFree(cpu);
|
||||
cpuDataFree(caps->host.arch, data);
|
||||
if (caps)
|
||||
cpuDataFree(caps->host.arch, data);
|
||||
|
||||
return caps;
|
||||
|
||||
|
|
Loading…
Reference in New Issue