Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Fix Client Mode memory Leak: #107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion stud.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,13 @@ SSL_CTX * init_openssl() {
init_dh(ctx, CONFIG->CERT_FILE);
#endif /* OPENSSL_NO_DH */

if (CONFIG->PMODE == SSL_CLIENT) {
/* Disable internal cache of openssl: session reuse cause memory leak
in SSL_SESS_CACHE_CLIENT mode */
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
}
#ifdef USE_SHARED_CACHE
if (CONFIG->SHARED_CACHE) {
else if (CONFIG->SHARED_CACHE) {
if (shared_context_init(ctx, CONFIG->SHARED_CACHE) < 0) {
ERR("Unable to alloc memory for shared cache.\n");
exit(1);
Expand Down