mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
xend: Fix a memory leak found by Coverity
Commit id '87b4c10c' moved the VIR_ALLOC_N, but didn't check if 'cpuset' had been allocated on failure.
This commit is contained in:
parent
d951c1a0b9
commit
f9799f1abf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user