projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2344c63
)
src/plugin.c: unregister_read: llist_search may return NULL.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 29 Aug 2009 11:58:56 +0000
(13:58 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 29 Aug 2009 11:58:56 +0000
(13:58 +0200)
Handle these cases gracefully.
src/plugin.c
patch
|
blob
|
history
diff --git
a/src/plugin.c
b/src/plugin.c
index
70e0c0f
..
6fb7520
100644
(file)
--- 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;