Skip to content
Snippets Groups Projects
Commit 0700951f authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Mutex-protect access to cryptfail.

Totally not sketchy, trust me.
parent a94df9ea
No related branches found
No related tags found
No related merge requests found
Pipeline #5391 failed
......@@ -364,6 +364,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...))
return false;
}
if (!cryptlib_initialized) {
pthread_mutex_lock(&ssl_sess_list_mutex);
if (cryptfail) {
lprintf(LOG_ERR,"cryptInit() returned %d: %s", cryptInit_error, cryptfail);
free(cryptfail);
......@@ -371,6 +372,7 @@ bool do_cryptInit(int (*lprintf)(int level, const char* fmt, ...))
}
else
lprintf(LOG_ERR,"cryptInit() returned %d", cryptInit_error);
pthread_mutex_unlock(&ssl_sess_list_mutex);
}
return cryptlib_initialized;
}
......
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