aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/src/module.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/src/module.c b/utils/src/module.c
index 93ced62..c325d97 100644
--- a/utils/src/module.c
+++ b/utils/src/module.c
@@ -146,12 +146,11 @@ struct module *module_open(const char *file, int flag)
new->ref_count = 1;
new->priv = NULL;
new->next = NULL;
+ new->handle = NULL;
- dlerror();
new->handle = dlopen(file, flag);
- dlerr = dlerror();
- if (dlerr) {
- LOGE("dlopen failed (%s)\n", dlerr);
+ if (!(new->handle)) {
+ LOGE("dlopen failed (%s)\n", file);
module_set_error(dlerr);
pthread_mutex_unlock(&g_lock);
goto free_new;