From: Guido Günther Date: Fri, 20 Jan 2012 07:56:39 +0000 (+0100) Subject: xen: Don't crash when we fail to init caps X-Git-Tag: v0.9.10-rc1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=549cedc6a9f0505de3930f42846c2a569caa91b9;p=thirdparty%2Flibvirt.git xen: Don't crash when we fail to init caps by dereferencing a NULL pointer in the call to virNodeSuspendGetTargetMask. --- diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 5e7196712f..b5b2328c22 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -2764,6 +2764,8 @@ xenHypervisorMakeCapabilities(virConnectPtr conn) utsname.machine, cpuinfo, capabilities); + if (caps == NULL) + return NULL; if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) VIR_WARN("Failed to get host power management capabilities");