X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.c;h=24e5e01e7bb06ceb1e12f1a45881a16505bd761a;hb=00a87614c6652bf67be9d717dc4ef9efd703f552;hp=70e0c0ffcf367e5f030e86a394fddf7e2d7c315c;hpb=2c4802dbdf90c721202fd87f8141ab079b085c56;p=collectd.git diff --git a/src/plugin.c b/src/plugin.c index 70e0c0ff..24e5e01e 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; @@ -1416,7 +1424,12 @@ void plugin_log (int level, const char *format, ...) llentry_t *le; if (list_log == NULL) + { + va_start (ap, format); + vfprintf (stderr, format, ap); + va_end (ap); return; + } #if !COLLECT_DEBUG if (level >= LOG_DEBUG)