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:
John Ferlan 2013-01-07 12:09:30 -05:00 committed by Eric Blake
parent f36d83c441
commit 185478af09

View File

@ -127,6 +127,7 @@ vmwareCapsInit(void)
cleanup: cleanup:
virCPUDefFree(cpu); virCPUDefFree(cpu);
if (caps)
cpuDataFree(caps->host.arch, data); cpuDataFree(caps->host.arch, data);
return caps; return caps;