- if ((xpathCtx = xmlXPathNewContext(doc)) == NULL) {
- ERROR ("bind plugin: xmlXPathNewContext failed.");
- goto out;
- }
- /* Look for /isc/bind/statistics[@version='2.0'] */
- if ((xpathObj = xmlXPathEvalExpression(BAD_CAST "/isc[@version='1.0']/bind/statistics[@version='1.0']", xpathCtx)) == NULL) {
- ERROR("bind plugin: unable to evaluate XPath expression StatsV1");
- goto out;
- } else if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0) {
- /* We have Bind-9.5.x */
- ret = bind_xml_stats_v1(doc, xpathCtx, xpathObj->nodesetval->nodeTab[0]);
- goto out;
- } else {
+ if ((xpathCtx = xmlXPathNewContext(doc)) == NULL) {
+ ERROR ("bind plugin: xmlXPathNewContext failed.");
+ break;
+ }
+
+ /* Look for /isc/bind/statistics[@version='1.0'] */
+ xpathObj = xmlXPathEvalExpression(BAD_CAST "/isc[@version='1.0']/bind/statistics[@version='1.0']", xpathCtx);
+ if (xpathObj == NULL)
+ {
+ ERROR("bind plugin: unable to evaluate XPath expression StatsV1");
+ break;
+ }
+ else if (xpathObj->nodesetval && xpathObj->nodesetval->nodeNr > 0)
+ {
+ /* We have Bind-9.5.x */
+ ret = bind_xml_stats_v1(doc, xpathCtx, xpathObj->nodesetval->nodeTab[0]);
+ break;
+ }
+
+ /* Not Bind-9.5.x. Let's clear up and try Bind-9.6.x instead. */