diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 641088c9ccb215a37a6dc245485c1cf0387049db..27b87fc60c5a73b089cdd7caf4ecb9ee79dc4d0a 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1127,8 +1127,10 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps) goto error; } - if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) + if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) { + virBitmapFree(cpuset); goto memory_error; + } for (n = 0, cpu = 0; cpu < numCpus; cpu++) { bool used;