Actually fix Coverity CID 56281: dlopen() resource leak

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-02-18 22:59:32 +01:00
parent ad8ae4af91
commit a7353678a3
+4 -2
View File
@@ -230,12 +230,14 @@ static int load_one(char *path, char *name)
return 1;
}
/* Remember handle from dlopen() for plugin_unregister() */
plugin = TAILQ_LAST(&plugins, plugin_head);
if (!plugin) {
_e("Plugin %s failed to register.", sofile);
_e("Plugin %s failed to register, unloading from memory.", sofile);
dlclose(handle);
return 1;
}
/* Remember handle from dlopen() for plugin_unregister() */
plugin->handle = handle;
return 0;