Skip to content

Commit

Permalink
Revert "BUG/MINOR: ssl: fix potential memory leak in ssl_sock_load_dh…
Browse files Browse the repository at this point in the history
…_params()"

This reverts commit 0ea4c23.

Certain very simple confs randomly segfault upon startup with openssl 1.0.2
with this patch, which seems to indicate a use after free. Better drop it
and let valgrind complain about the potential leak.

Also it's worth noting that the man page for SSL_CTX_set_tmp_dh() makes no
mention about whether or not the element should be freed, and the example
provided does not use it either.

This fix should be backported to 1.6 and 1.5 where the patch was just
included.
  • Loading branch information
wtarreau committed Jun 30, 2016
1 parent 831962e commit 90fd35c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/ssl_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,6 @@ 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);
Expand Down

0 comments on commit 90fd35c

Please sign in to comment.