BUG/MINOR: ssl: fix potential memory leak in ssl_sock_load_dh_params()

Valgrind reports that the memory allocated in ssl_get_dh_1024() was leaking. Upon further inspection of openssl code, it seems that SSL_CTX_set_tmp_dh makes a copy of the data, so calling DH_free afterwards makes sense.
This commit is contained in:
Roberto Guimaraes 2016-06-11 15:58:10 -07:00 committed by Willy Tarreau
parent 4b788f7d34
commit 0ea4c23ca7

View File

@ -1643,6 +1643,7 @@ int ssl_sock_load_dh_params(SSL_CTX *ctx, const char *file)
goto end;
SSL_CTX_set_tmp_dh(ctx, local_dh_1024);
DH_free(local_dh_1024);
}
else {
SSL_CTX_set_tmp_dh_callback(ctx, ssl_get_tmp_dh);