diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 92a371866e1392457f453111e181e41db3585731..af23b8b2fb6d89343aea512690f4bcfccbd5af95 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -1933,17 +1933,13 @@ nodeCapsInitNUMA(virCapsPtr caps) ret = 0; cleanup: - if (topology_failed || ret < 0) + if ((topology_failed || ret < 0) && cpus) virCapabilitiesClearHostNUMACellCPUTopology(cpus, ncpus); virBitmapFree(cpumap); VIR_FREE(cpus); VIR_FREE(siblings); VIR_FREE(pageinfo); - - if (ret < 0) - VIR_FREE(cpus); - return ret; }