diff options
author | Stef Walter <stef@memberwebs.com> | 2008-12-01 19:27:45 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2008-12-01 19:27:45 +0000 |
commit | d1944835599808d5b13b470c84b762e64561b4ec (patch) | |
tree | 7d0a8e2b9b89ecd33ab39930cbd87c36bc36e106 | |
parent | f2637dea1ef8646bac64f2041c6da223f75dfc75 (diff) |
Fix crash which happens when closeall is called at a strange time.
-rw-r--r-- | ckcapi-session.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ckcapi-session.c b/ckcapi-session.c index 0d71fe2..dc5b976 100644 --- a/ckcapi-session.c +++ b/ckcapi-session.c @@ -347,6 +347,9 @@ ckcapi_session_close_all(CK_SLOT_ID slot) DBG(("closing all sessions for: %d", slot)); + if(!all_sessions) + return CKR_OK; + ckcapi_lock_global(); sessions = ckcapi_array_sized_new(0, 1, sizeof(CkCapiSession*), |