From: Florian Forster Date: Sat, 29 Aug 2009 11:58:56 +0000 (+0200) Subject: src/plugin.c: unregister_read: llist_search may return NULL. X-Git-Tag: collectd-4.7.3~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2f23f605cb74588854b67b6a50850dbaa4d8d93d;p=collectd.git src/plugin.c: unregister_read: llist_search may return NULL. Handle these cases gracefully. --- diff --git a/src/plugin.c b/src/plugin.c index 70e0c0ff..6fb75206 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -888,6 +888,14 @@ int plugin_unregister_read (const char *name) /* {{{ */ } le = llist_search (read_list, name); + if (le == NULL) + { + pthread_mutex_unlock (&read_lock); + WARNING ("plugin_unregister_read: No such read function: %s", + name); + return (-ENOENT); + } + llist_remove (read_list, le); rf = le->value;