projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dc415e5
)
curl_xml: Use of xmlFree() for values returned by xmlNodeGetContent()
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Wed, 4 Oct 2017 16:59:46 +0000
(23:59 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Wed, 4 Oct 2017 16:59:46 +0000
(23:59 +0700)
src/curl_xml.c
patch
|
blob
|
history
diff --git
a/src/curl_xml.c
b/src/curl_xml.c
index
f5a29b0
..
c99e3f1
100644
(file)
--- a/
src/curl_xml.c
+++ b/
src/curl_xml.c
@@
-276,6
+276,9
@@
static int cx_if_not_text_node(xmlNodePtr node) /* {{{ */
return -1;
} /* }}} cx_if_not_text_node */
return -1;
} /* }}} cx_if_not_text_node */
+/*
+ * Returned value should be freed with xmlFree().
+ */
static char *cx_get_text_node_value(xmlXPathContextPtr xpath_ctx, /* {{{ */
char *expr, const char *from_option) {
xmlXPathObjectPtr values_node_obj = cx_evaluate_xpath(xpath_ctx, expr);
static char *cx_get_text_node_value(xmlXPathContextPtr xpath_ctx, /* {{{ */
char *expr, const char *from_option) {
xmlXPathObjectPtr values_node_obj = cx_evaluate_xpath(xpath_ctx, expr);
@@
-353,7
+356,7
@@
static int cx_handle_single_value_xpath(xmlXPathContextPtr xpath_ctx, /* {{{ */
/* endptr = */ NULL);
}
/* endptr = */ NULL);
}
-
sf
ree(node_value);
+
xmlF
ree(node_value);
/* We have reached here which means that
* we have got something to work */
/* We have reached here which means that
* we have got something to work */
@@
-397,7
+400,7
@@
static int cx_handle_instance_xpath(xmlXPathContextPtr xpath_ctx, /* {{{ */
else
sstrncpy(vl->type_instance, node_value, sizeof(vl->type_instance));
else
sstrncpy(vl->type_instance, node_value, sizeof(vl->type_instance));
-
sf
ree(node_value);
+
xmlF
ree(node_value);
} else if (xpath->instance_prefix != NULL)
sstrncpy(vl->type_instance, xpath->instance_prefix,
sizeof(vl->type_instance));
} else if (xpath->instance_prefix != NULL)
sstrncpy(vl->type_instance, xpath->instance_prefix,
sizeof(vl->type_instance));
@@
-411,7
+414,7
@@
static int cx_handle_instance_xpath(xmlXPathContextPtr xpath_ctx, /* {{{ */
return -1;
sstrncpy(vl->plugin_instance, node_value, sizeof(vl->plugin_instance));
return -1;
sstrncpy(vl->plugin_instance, node_value, sizeof(vl->plugin_instance));
-
sf
ree(node_value);
+
xmlF
ree(node_value);
}
return 0;
}
return 0;