[libvirt-glib] Correctly handle blank nodes in _foreach_child

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When encountering a blank node, the child iterator wasn't set to
point to the next node leading to an infinite loop.
---
 libvirt-gconfig/libvirt-gconfig-helpers.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libvirt-gconfig/libvirt-gconfig-helpers.c b/libvirt-gconfig/libvirt-gconfig-helpers.c
index 6500439..071a1e7 100644
--- a/libvirt-gconfig/libvirt-gconfig-helpers.c
+++ b/libvirt-gconfig/libvirt-gconfig-helpers.c
@@ -172,14 +172,14 @@ void gvir_config_xml_foreach_child(xmlNodePtr node,
 
     it = node->children;
     while (it != NULL) {
-        gboolean cont;
         xmlNodePtr next = it->next;
 
-        if (xmlIsBlankNode(it))
-            continue;
-        cont = iter_func(it, opaque);
-        if (!cont)
-            break;
+        if (!xmlIsBlankNode(it)) {
+            gboolean cont;
+            cont = iter_func(it, opaque);
+            if (!cont)
+                break;
+        }
         it = next;
     }
 }
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]