mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
conf: Make really sure we don't access non-existing vCPUs again
MinGW complained that we might be dereferencing a NULL pointer. While that can't be true, the logic certainly allows for that. ../../src/conf/domain_conf.c: In function 'virDomainDefPostParse': ../../src/conf/domain_conf.c:4224:18: error: potential null pointer dereference [-Werror=null-dereference] if (!vcpu->online && vcpu->cpumask) { ~~~~^~~~~~~~ Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
ffc49e579c
commit
05f89657ee
@ -4221,7 +4221,7 @@ virDomainDefRemoveOfflineVcpuPin(virDomainDefPtr def)
|
|||||||
for (i = 0; i < virDomainDefGetVcpusMax(def); i++) {
|
for (i = 0; i < virDomainDefGetVcpusMax(def); i++) {
|
||||||
vcpu = virDomainDefGetVcpu(def, i);
|
vcpu = virDomainDefGetVcpu(def, i);
|
||||||
|
|
||||||
if (!vcpu->online && vcpu->cpumask) {
|
if (vcpu && !vcpu->online && vcpu->cpumask) {
|
||||||
virBitmapFree(vcpu->cpumask);
|
virBitmapFree(vcpu->cpumask);
|
||||||
vcpu->cpumask = NULL;
|
vcpu->cpumask = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user