Skip to content

Commit

Permalink
Added check in pkcs11_CTX_unload() to ensure the module is loaded bef…
Browse files Browse the repository at this point in the history
…ore attempting shutdown
  • Loading branch information
olszomal committed Oct 25, 2024
1 parent 075849c commit 97a222c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/p11_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ void pkcs11_CTX_unload(PKCS11_CTX *ctx)
{
PKCS11_CTX_private *cpriv = PRIVCTX(ctx);

if (!cpriv->method) /* Module not loaded */
return;

/* Tell the PKCS11 library to shut down */
if (cpriv->forkid == get_forkid())
cpriv->method->C_Finalize(NULL);
Expand Down

0 comments on commit 97a222c

Please sign in to comment.