/* If the base xpath returns more than one block, the result is assumed to be
* a table. The `Instance' option is not optional in this case. Check for the
* condition and inform the user. */
/* If the base xpath returns more than one block, the result is assumed to be
* a table. The `Instance' option is not optional in this case. Check for the
* condition and inform the user. */
{
WARNING ("curl_xml plugin: "
"Base-XPath %s is a table (more than one result was returned), "
{
WARNING ("curl_xml plugin: "
"Base-XPath %s is a table (more than one result was returned), "
ssnprintf (vl->type_instance, sizeof (vl->type_instance),"%s%s",
ssnprintf (vl->type_instance, sizeof (vl->type_instance),"%s%s",
else
sstrncpy (vl->type_instance, xpath->instance_prefix,
sizeof (vl->type_instance));
else
sstrncpy (vl->type_instance, xpath->instance_prefix,
sizeof (vl->type_instance));
/* If instance_prefix and instance_node are NULL, then
* don't set the type_instance */
if (instance_node != NULL)
/* If instance_prefix and instance_node are NULL, then
* don't set the type_instance */
if (instance_node != NULL)
- sstrncpy (vl->type_instance, (char *) xmlNodeGetContent(instance_node->nodeTab[0]),
- sizeof (vl->type_instance));
+ {
+ char *node_value = (char *) xmlNodeGetContent(instance_node->nodeTab[0]);
+ sstrncpy (vl->type_instance, node_value, sizeof (vl->type_instance));
+ sfree (node_value);
+ }