projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
74dc5ed
)
curl_xml plugin: Make absolutely certain “instance_node_obj” is freed.
author
Florian Forster
<octo@huhu.verplant.org>
Mon, 11 Jan 2010 14:46:30 +0000
(15:46 +0100)
committer
Florian Forster
<octo@huhu.verplant.org>
Mon, 11 Jan 2010 14:46:30 +0000
(15:46 +0100)
src/curl_xml.c
patch
|
blob
|
history
diff --git
a/src/curl_xml.c
b/src/curl_xml.c
index
7805166
..
5fd3f59
100644
(file)
--- 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)
{
/* 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 */
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)
sfree(vl.values);
if (instance_node_obj != NULL)
+ {
xmlXPathFreeObject (instance_node_obj);
xmlXPathFreeObject (instance_node_obj);
- }
+ instance_node_obj = NULL;
+ }
+ } /* for (i = 0; i < total_nodes; i++) */
/* free up the allocated memory */
xmlXPathFreeObject (base_node_obj);
/* free up the allocated memory */
xmlXPathFreeObject (base_node_obj);