Skip to content
Snippets Groups Projects
Commit c4787c5c authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6392: fix a memory leak in abookfactory_load_module()

bug found by cppcheck
parent 1c0e9668
No related branches found
No related tags found
No related merge requests found
......@@ -65,14 +65,14 @@ void abookfactory_load_module(AddrBookFactory *factory) {
DEBUG("AddressbookFactory: Loading addressbook: %s", pluginpath);
ab = g_malloc(sizeof(AddrBookHandle));
handle = dlopen(pluginpath, RTLD_LAZY);
g_free(pluginpath);
if(handle == NULL) {
ERROR("AddressbookFactory: Error: Could not load addressbook");
return;
}
g_free(pluginpath);
ab = g_malloc(sizeof(AddrBookHandle));
ab->init = dlsym(handle, "addressbook_init");
if(ab->init == NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment