Skip to content
Snippets Groups Projects
Commit 4197ced7 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix new crash on startup for Windows build

load_cfg() calls free_cfg() before do_cryptInit() is called, so the ssl_rwlock
was uninitialized here.
parent d18f101f
No related branches found
No related tags found
No related merge requests found
Pipeline #5019 passed
...@@ -349,12 +349,14 @@ void prep_cfg(scfg_t* cfg) ...@@ -349,12 +349,14 @@ void prep_cfg(scfg_t* cfg)
void free_cfg(scfg_t* cfg) void free_cfg(scfg_t* cfg)
{ {
#if defined(SBBS) && defined(USE_CRYPTLIB) #if defined(SBBS) && defined(USE_CRYPTLIB)
lock_ssl_cert(); if(cfg->prepped) {
if (cfg->tls_certificate != -1 && cfg->prepped) { lock_ssl_cert();
cryptDestroyContext(cfg->tls_certificate); if (cfg->tls_certificate != -1 && cfg->prepped) {
cfg->tls_certificate = -1; cryptDestroyContext(cfg->tls_certificate);
cfg->tls_certificate = -1;
}
unlock_ssl_cert();
} }
unlock_ssl_cert();
#endif #endif
free_node_cfg(cfg); free_node_cfg(cfg);
free_main_cfg(cfg); free_main_cfg(cfg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment