We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 627f516 commit f878c43Copy full SHA for f878c43
1 file changed
wolfcrypt/src/wc_port.c
@@ -576,11 +576,16 @@ int wolfCrypt_Cleanup(void)
576
#endif
577
578
(void)wolfSSL_Atomic_Int_SubFetch(&initRefCount, 1);
579
- }
580
581
#if defined(HAVE_LIBOQS)
582
- wolfSSL_liboqsClose();
+ wolfSSL_liboqsClose();
583
+ }
584
+ else if (my_initRefCount < 0) {
585
+ (void)wolfSSL_Atomic_Int_AddFetch(&initRefCount, 1);
586
+ WOLFSSL_MSG("wolfCrypt_Cleanup() called with initRefCount <= 0.");
587
+ ret = ALREADY_E;
588
589
590
return ret;
591
}
0 commit comments