Call dlclose() only when having a valid handle.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
parent
fc5714a4c9
commit
218d198bdc
@ -74,7 +74,7 @@ C_UnloadModule(void *module)
|
||||
if (!mod || mod->_magic != MAGIC)
|
||||
return CKR_ARGUMENTS_BAD;
|
||||
|
||||
if (sc_dlclose(mod->handle) < 0)
|
||||
if (mod->handle != NULL && sc_dlclose(mod->handle) < 0)
|
||||
return CKR_FUNCTION_FAILED;
|
||||
|
||||
memset(mod, 0, sizeof(*mod));
|
||||
|
Loading…
Reference in New Issue
Block a user