mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
Actually fix Coverity CID 56281: dlopen() resource leak
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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