Skip to content
Snippets Groups Projects
Commit e35e3a60 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 3e8e114d
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -349,12 +349,14 @@ void prep_cfg(scfg_t* cfg)
void free_cfg(scfg_t* cfg)
{
#if defined(SBBS) && defined(USE_CRYPTLIB)
lock_ssl_cert();
if (cfg->tls_certificate != -1 && cfg->prepped) {
cryptDestroyContext(cfg->tls_certificate);
cfg->tls_certificate = -1;
if(cfg->prepped) {
lock_ssl_cert();
if (cfg->tls_certificate != -1 && cfg->prepped) {
cryptDestroyContext(cfg->tls_certificate);
cfg->tls_certificate = -1;
}
unlock_ssl_cert();
}
unlock_ssl_cert();
#endif
free_node_cfg(cfg);
free_main_cfg(cfg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment