Fix ex_data memory leak
authorTodd Short <tshort@akamai.com>
Fri, 26 May 2017 12:42:21 +0000 (08:42 -0400)
committerRich Salz <rsalz@openssl.org>
Thu, 1 Jun 2017 20:51:33 +0000 (16:51 -0400)
commit24638211da59aaea93f3f85d8dd6ef0a36a8644e
treeaefed8166b8d6716f63c1d9fc08cb3c05ea3456f
parent9a2a0617e5b042ae5d5b53886e30dc47fe778f7f
Fix ex_data memory leak

Code was added in commit 62f488d that overwrite the last ex_data valye
using CRYPTO_dup_ex_data() causing a memory leak and potentially
confusing the ex_data dup() callback.

In ssl_session_dup(), new-up the ex_data before calling
CRYPTO_dup_ex_data(); all the other structures that dup ex_data have
the destination ex_data new'd before the dup.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3568)
crypto/ex_data.c
ssl/ssl_sess.c