From 549cedc6a9f0505de3930f42846c2a569caa91b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 20 Jan 2012 08:56:39 +0100 Subject: [PATCH] xen: Don't crash when we fail to init caps by dereferencing a NULL pointer in the call to virNodeSuspendGetTargetMask. --- src/xen/xen_hypervisor.c | 2 ++ 1 file changed, 2 insertions(+) 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");