summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p11-kit/modules.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index c979f2a..3da1a7d 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -1523,7 +1523,10 @@ managed_C_Finalize (CK_X_FUNCTION_LIST *self,
p11_lock ();
pid = getpid ();
- if (managed->initialized != pid) {
+ if (managed->initialized == 0) {
+ rv = CKR_CRYPTOKI_NOT_INITIALIZED;
+
+ } else if (managed->initialized != pid) {
/*
* In theory we should be returning CKR_CRYPTOKI_NOT_INITIALIZED here
* but enough callers are not completely aware of their forking.