From 1985137b8d20858948ba83020b911f864bc7faad Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 18 Oct 2008 19:02:09 +0200 Subject: [PATCH] obexd: Simplify plugin descriptor checking --- obexd/src/plugin.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/obexd/src/plugin.c b/obexd/src/plugin.c index 37b2df094..13dda96a3 100644 --- a/obexd/src/plugin.c +++ b/obexd/src/plugin.c @@ -46,6 +46,9 @@ static gboolean add_plugin(void *handle, struct obex_plugin_desc *desc) { struct obex_plugin *plugin; + if (desc->init == NULL) + return FALSE; + plugin = g_try_new0(struct obex_plugin, 1); if (plugin == NULL) return FALSE; @@ -113,11 +116,6 @@ gboolean plugin_init(void) continue; } - if (desc->init == NULL) { - dlclose(handle); - continue; - } - if (add_plugin(handle, desc) == FALSE) dlclose(handle); } -- 2.47.3