From 044cb79594f94632eedf24a7bbfb8e645691a6d3 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 23 Mar 2013 09:53:28 +0100 Subject: [PATCH] src/plugin.c: Assert that "data_sets" is non-NULL. 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugin.c b/src/plugin.c index 453e896b..4c6a0322 100644 --- 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); -- 2.11.0