summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e686e07)
raw | patch | inline | side by side (parent: e686e07)
author | Florian Forster <octo@huhu.verplant.org> | |
Wed, 14 Nov 2007 10:37:00 +0000 (11:37 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 14 Nov 2007 10:37:00 +0000 (11:37 +0100) |
..in a VERY uncommon/rare case.
src/rrdtool.c | patch | blob | history |
diff --git a/src/rrdtool.c b/src/rrdtool.c
index fbd836020f95f14dad6bf1dfd2d69ab1146b9c66..79331bf73dce12a6660c29f032af29f283463b79 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
}
else /* ancient and no values -> waste of memory */
{
- keys = (char **) realloc ((void *) keys,
+ char **tmp = (char **) realloc ((void *) keys,
(keys_num + 1) * sizeof (char *));
- if (keys == NULL)
+ if (tmp == NULL)
{
char errbuf[1024];
ERROR ("rrdtool plugin: "
sstrerror (errno, errbuf,
sizeof (errbuf)));
c_avl_iterator_destroy (iter);
+ sfree (keys);
return;
}
+ keys = tmp;
keys[keys_num] = key;
keys_num++;
}
keys[i] = NULL;
} /* for (i = 0..keys_num) */
- free (keys);
+ sfree (keys);
cache_flush_last = now;
} /* void rrd_cache_flush */