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,7 +127,8 @@ vmwareCapsInit(void)
cleanup:
virCPUDefFree(cpu);
cpuDataFree(caps->host.arch, data);
if (caps)
cpuDataFree(caps->host.arch, data);
return caps;