projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b788f7
)
BUG/MINOR: ssl: fix potential memory leak in ssl_sock_load_dh_params()
author
Roberto Guimaraes
<rguimaraes@fastly.com>
Sat, 11 Jun 2016 22:58:10 +0000
(15:58 -0700)
committer
Willy Tarreau
<w@1wt.eu>
Sun, 12 Jun 2016 11:12:32 +0000
(13:12 +0200)
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.
src/ssl_sock.c
patch
|
blob
|
history
diff --git
a/src/ssl_sock.c
b/src/ssl_sock.c
index
0d35c29
..
378fddc
100644
(file)
--- a/
src/ssl_sock.c
+++ b/
src/ssl_sock.c
@@
-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);