From 2f23f605cb74588854b67b6a50850dbaa4d8d93d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 29 Aug 2009 13:58:56 +0200 Subject: [PATCH] src/plugin.c: unregister_read: llist_search may return NULL. Handle these cases gracefully. --- src/plugin.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.30.2