X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_xml.c;h=58cb42db7e20daf818c82253fb7e7b17e03696fb;hb=810e8f5d687514841ed0ea445764ccc05e8f5299;hp=03ac0c1332f39f8bfc61f4c22889dbadd2b1e6e9;hpb=09c12e0e1e0ef340a7074146684650ed54cba64d;p=collectd.git diff --git a/src/curl_xml.c b/src/curl_xml.c index 03ac0c13..58cb42db 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -217,16 +217,19 @@ static void cx_free (void *arg) /* {{{ */ static int cx_config_append_string (const char *name, struct curl_slist **dest, /* {{{ */ oconfig_item_t *ci) { + struct curl_slist *temp = NULL; if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) { WARNING ("curl_xml plugin: `%s' needs exactly one string argument.", name); return (-1); } - *dest = curl_slist_append(*dest, ci->values[0].value.string); - if (*dest == NULL) + temp = curl_slist_append(*dest, ci->values[0].value.string); + if (temp == NULL) return (-1); + *dest = temp; + return (0); } /* }}} int cx_config_append_string */