From 74dc5ede8695cf7030d4053a483abd78c1572d77 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 11 Jan 2010 15:46:07 +0100 Subject: [PATCH] =?utf8?q?curl=5Fxml=20plugin:=20Check=20the=20return=20va?= =?utf8?q?lue=20of=20=E2=80=9Ccx=5Fevaluate=5Fxpath=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/curl_xml.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/curl_xml.c b/src/curl_xml.c index a8dbc1cc..78051667 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -251,7 +251,6 @@ static int cx_submit_xpath_values (char *plugin_instance, /* {{{ */ xmlXPathObjectPtr base_node_obj = NULL; xmlXPathObjectPtr instance_node_obj = NULL; - xmlXPathObjectPtr values_node_obj = NULL; xmlNodeSetPtr base_nodes = NULL; xmlNodeSetPtr instance_node = NULL; xmlNodeSetPtr values_node = NULL; @@ -337,11 +336,16 @@ static int cx_submit_xpath_values (char *plugin_instance, /* {{{ */ xmlXPathFreeObject (instance_node_obj); continue; } - } + } /* if (xpath->instance != NULL) */ for (j = 0; j < xpath->values_len; j++) { + xmlXPathObjectPtr values_node_obj; + values_node_obj = cx_evaluate_xpath (xpath_ctx, BAD_CAST xpath->values[j].path); + if (values_node_obj == NULL) + continue; /* Error already logged. */ + values_node = values_node_obj->nodesetval; tmp_size = (values_node) ? values_node->nodeNr : 0; -- 2.30.2