diff options
-rw-r--r-- | p11-kit/modules.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c index bbeeef6..fac4707 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -1689,9 +1689,13 @@ managed_C_CloseAllSessions (CK_X_FUNCTION_LIST *self, self = &managed->mod->virt.funcs; managed_close_sessions (self, stolen, count); - free (stolen); + if (stolen) { + free (stolen); + return CKR_OK; + } else { + return CKR_GENERAL_ERROR; + } - return stolen ? CKR_OK : CKR_GENERAL_ERROR; } static void |