mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
Actually fix Coverity CID 56281: dlopen() resource leak
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
ad8ae4af91
commit
a7353678a3
1 file changed
+4
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user