mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 01:47:24 +03:00
libxl: Resolve possible NULL dereference
If we reached cleanup: prior to allocating cpus, it was possible that 'nr_nodes' had a value, but cpus was NULL leading to a possible NULL deref. Add a 'cpus' as an end condition to for loop
This commit is contained in:
parent
95577af442
commit
6aea4ebcd0
@ -196,7 +196,7 @@ libxlCapsInitNuma(libxl_ctx *ctx, virCapsPtr caps)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
for (i = 0; i < nr_nodes; i++)
|
for (i = 0; cpus && i < nr_nodes; i++)
|
||||||
VIR_FREE(cpus[i]);
|
VIR_FREE(cpus[i]);
|
||||||
virCapabilitiesFreeNUMAInfo(caps);
|
virCapabilitiesFreeNUMAInfo(caps);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user