From 963dca85df6fb2f5654d3de1d14ae991d550c870 Mon Sep 17 00:00:00 2001 From: Marius Rieder Date: Sun, 6 May 2007 16:41:45 +0200 Subject: [PATCH] src/plugin.c: Check `list_data_set' to be non-NULL before querying it. --- src/plugin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.11.0