mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
virsh: Don't traverse childless nodes in vshNodeIsSuperset
If both nodes do not have any children, we pass zero to virBitmapAlloc which returns NULL. In turn we report OOM error and return false (meaning nodes are different). This is not true.
This commit is contained in:
parent
d360795d60
commit
2d0fc93fdd
@ -11556,6 +11556,9 @@ vshNodeIsSuperset(xmlNodePtr n1, xmlNodePtr n2)
|
||||
if (n1_child_size < n2_child_size)
|
||||
return false;
|
||||
|
||||
if (n1_child_size == 0 && n2_child_size == 0)
|
||||
return true;
|
||||
|
||||
if (!(bitmap = virBitmapAlloc(n1_child_size))) {
|
||||
virReportOOMError();
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user