projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
344be49
)
src/plugin.c: Assert that "data_sets" is non-NULL.
author
Florian Forster
<octo@collectd.org>
Sat, 23 Mar 2013 08:53:28 +0000
(09:53 +0100)
committer
Florian Forster
<octo@collectd.org>
Sat, 23 Mar 2013 08:53:28 +0000
(09:53 +0100)
Otherwise we might run into an assertion in the AVL tree. This can be
triggered e.g. when calling plugin_get_ds() from within a config
callback.
src/plugin.c
patch
|
blob
|
history
diff --git
a/src/plugin.c
b/src/plugin.c
index
453e896
..
4c6a032
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-2016,6
+2016,12
@@
const data_set_t *plugin_get_ds (const char *name)
{
data_set_t *ds;
+ if (data_sets == NULL)
+ {
+ ERROR ("plugin_get_ds: No data sets are defined yet.");
+ return (NULL);
+ }
+
if (c_avl_get (data_sets, name, (void *) &ds) != 0)
{
DEBUG ("No such dataset registered: %s", name);