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:
Michal Privoznik 2011-11-28 17:43:51 +01:00
parent d360795d60
commit 2d0fc93fdd

View File

@ -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;