From 9cf086be6d916c52035a0ee89f3f0f020e9fee1f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 25 Aug 2016 18:40:09 -0400 Subject: [PATCH] conf: Fix build with picky GCC ../../src/conf/domain_conf.c:4425:21: error: potential null pointer dereference [-Werror=null-dereference] switch (vcpu->hotpluggable) { ~~~~^~~~~~~~~~~~~~ --- src/conf/domain_conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ae3eb14c5a..61f6dbbbaf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4422,6 +4422,10 @@ virDomainVcpuDefPostParse(virDomainDefPtr def) for (i = 0; i < maxvcpus; i++) { vcpu = virDomainDefGetVcpu(def, i); + /* impossible but some compilers don't like it */ + if (!vcpu) + continue; + switch (vcpu->hotpluggable) { case VIR_TRISTATE_BOOL_ABSENT: if (vcpu->online) -- GitLab