Force symbol resolving and fix memory leak
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 14 Oct 2008 15:55:52 +0000 (17:55 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 14 Oct 2008 15:55:52 +0000 (17:55 +0200)
src/plugin.c

index 7cbd72b..0d90fd9 100644 (file)
@@ -74,10 +74,11 @@ int __connman_plugin_init(void)
 
                        filename = g_build_filename(PLUGINDIR, file, NULL);
 
-                       handle = dlopen(filename, RTLD_LAZY);
+                       handle = dlopen(filename, RTLD_NOW);
                        if (handle == NULL) {
                                g_warning("Can't load %s: %s", filename,
                                                                dlerror());
+                               g_free(filename);
                                continue;
                        }
 
@@ -85,7 +86,7 @@ int __connman_plugin_init(void)
 
                        desc = dlsym(handle, "connman_plugin_desc");
                        if (desc == NULL) {
-                               g_warning("Can't load symbol");
+                               g_warning("Can't load symbol: %s", dlerror());
                                dlclose(handle);
                                continue;
                        }