/**
* collectd - src/rrdtool.c
- * Copyright (C) 2006 Florian octo Forster
+ * Copyright (C) 2006,2007 Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
char *saveptr = NULL;
char *dummy;
char *ptr;
+ char *value_copy;
int *tmp_alloc;
- dummy = value;
+ value_copy = strdup (value);
+ if (value_copy == NULL)
+ return (1);
+
+ dummy = value_copy;
while ((ptr = strtok_r (dummy, ", \t", &saveptr)) != NULL)
{
dummy = NULL;
if (tmp_alloc == NULL)
{
fprintf (stderr, "rrdtool: realloc failed.\n");
+ free (value_copy);
return (1);
}
rra_timespans_custom = tmp_alloc;
if (rra_timespans_custom[rra_timespans_custom_num] != 0)
rra_timespans_custom_num++;
} /* while (strtok_r) */
-
+ free (value_copy);
}
else if (strcasecmp ("XFF", key) == 0)
{
return (0);
} /* int rrd_init */
-void module_register (modreg_e load)
+void module_register (void)
{
plugin_register_config ("rrdtool", rrd_config,
config_keys, config_keys_num);