Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

protect ossl cleanup from multithreading errors #1472

Merged
merged 1 commit into from
May 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#if defined(OQS_USE_OPENSSL)
#include <openssl/evp.h>
#include "ossl_helpers.h"
CRYPTO_ONCE OQS_ONCE_STATIC_FREE;
#endif

/* Identifying the CPU is expensive so we cache the results in cpu_ext_data */
Expand Down Expand Up @@ -216,7 +217,7 @@ OQS_API const char *OQS_version(void) {

OQS_API void OQS_destroy(void) {
#if defined(OQS_USE_OPENSSL)
oqs_free_ossl_objects();
CRYPTO_THREAD_run_once(&OQS_ONCE_STATIC_FREE, oqs_free_ossl_objects);
#endif
return;
}
Expand Down