mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-23 06:23:10 +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;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC_N(cpuInfo, numCpus) < 0)
|
if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) {
|
||||||
|
virBitmapFree(cpuset);
|
||||||
goto memory_error;
|
goto memory_error;
|
||||||
|
}
|
||||||
|
|
||||||
for (n = 0, cpu = 0; cpu < numCpus; cpu++) {
|
for (n = 0, cpu = 0; cpu < numCpus; cpu++) {
|
||||||
bool used;
|
bool used;
|
||||||
|
Loading…
Reference in New Issue
Block a user