From: Tim Wiederhake Date: Tue, 6 Jul 2021 08:35:27 +0000 (+0200) Subject: virNWFilterParseParamAttributes: Iterate over "element" children X-Git-Tag: v7.6.0-rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71a2cdb8ec23a416d63684bd26da2b28408283e6;p=thirdparty%2Flibvirt.git virNWFilterParseParamAttributes: Iterate over "element" children "xmlNextElementSibling()" skips attribute nodes, making the explicit check for the type of `cur` redundant. This prepares for the removal of this check in the next commit. Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko --- diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index c94e9679f8..3754cec55f 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -703,7 +703,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) GHashTable *table = virHashNew(virNWFilterVarValueHashFree); - cur = cur->children; + cur = xmlFirstElementChild(cur); while (cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { @@ -739,7 +739,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) VIR_FREE(val); } } - cur = cur->next; + cur = xmlNextElementSibling(cur); } return table;