summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4059b7f)
raw | patch | inline | side by side (parent: 4059b7f)
author | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Fri, 20 Apr 2007 06:33:07 +0000 (08:33 +0200) | ||
committer | Florian Forster <octo@crystal.wlan.home.verplant.org> | |
Fri, 20 Apr 2007 06:33:07 +0000 (08:33 +0200) |
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 814b3e390f137fea1009260667329433686516ef..b4bb3fbeda224f5efb88feb4866a7b725d87722d 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
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)
{