From e7c4bd42a615b65882e26064081734d4c0e9f988 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 11 Jan 2010 15:46:30 +0100 Subject: [PATCH] =?utf8?q?curl=5Fxml=20plugin:=20Make=20absolutely=20certa?= =?utf8?q?in=20=E2=80=9Cinstance=5Fnode=5Fobj=E2=80=9D=20is=20freed.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/curl_xml.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/curl_xml.c b/src/curl_xml.c index 78051667..5fd3f59a 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -299,6 +299,7 @@ static int cx_submit_xpath_values (char *plugin_instance, /* {{{ */ /* instance has to be an xpath expression */ if (xpath->instance != NULL) { + assert (instance_node_obj == NULL); instance_node_obj = cx_evaluate_xpath (xpath_ctx, BAD_CAST xpath->instance); if (instance_node_obj == NULL) continue; /* error is logged already */ @@ -438,8 +439,11 @@ static int cx_submit_xpath_values (char *plugin_instance, /* {{{ */ sfree(vl.values); if (instance_node_obj != NULL) + { xmlXPathFreeObject (instance_node_obj); - } + instance_node_obj = NULL; + } + } /* for (i = 0; i < total_nodes; i++) */ /* free up the allocated memory */ xmlXPathFreeObject (base_node_obj); -- 2.11.0