From: Marius Rieder Date: Sun, 6 May 2007 14:41:45 +0000 (+0200) Subject: src/plugin.c: Check `list_data_set' to be non-NULL before querying it. X-Git-Tag: collectd-4.0.0-rc9~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=963dca85df6fb2f5654d3de1d14ae991d550c870;p=collectd.git src/plugin.c: Check `list_data_set' to be non-NULL before querying it. --- diff --git a/src/plugin.c b/src/plugin.c index ee1240cb..7dd7bd96 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -420,7 +420,8 @@ int plugin_register_data_set (const data_set_t *ds) data_set_t *ds_copy; int i; - if (llist_search (list_data_set, ds->type) != NULL) + if ((list_data_set != NULL) + && (llist_search (list_data_set, ds->type) != NULL)) { NOTICE ("Replacing DS `%s' with another version.", ds->type); plugin_unregister_data_set (ds->type); @@ -493,6 +494,9 @@ int plugin_unregister_data_set (const char *name) llentry_t *e; data_set_t *ds; + if (list_data_set == NULL) + return (-1); + e = llist_search (list_data_set, name); if (e == NULL) @@ -615,7 +619,7 @@ int plugin_dispatch_values (const char *name, const value_list_t *vl) data_set_t *ds; llentry_t *le; - if (list_write == NULL) + if ((list_write == NULL) || (list_data_set == NULL)) return (-1); le = llist_search (list_data_set, name);