Skip to content

Commit 932c086

Browse files
AlexShalimovmtrojnar
authored andcommitted
p11_load.c: fixed crash when loaded dll initializes with error
1 parent 0219f56 commit 932c086

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/p11_load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void pkcs11_CTX_unload(PKCS11_CTX *ctx)
144144
{
145145
PKCS11_CTX_private *cpriv = PRIVCTX(ctx);
146146

147-
if (!cpriv->method) /* Module not loaded */
147+
if (!cpriv->method || !cpriv->handle) /* Module not loaded */
148148
return;
149149

150150
/* Tell the PKCS11 library to shut down */

0 commit comments

Comments
 (0)