diff options
author | Matt Caswell <matt@openssl.org> | 2016-12-06 10:49:01 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-12-12 13:16:22 +0000 |
commit | 550e1d07a69db5af9129533ba7983594b3ed3fec (patch) | |
tree | c5be86f3c3a255249924d4448fdca31911fb65fd /test/sslapitest.c | |
parent | 2ece9c1fc6c5d998dc2abe03f2caf278ec05d9d0 (diff) |
Fix a leak in SSL_clear()
SSL_clear() was resetting numwpipes to 0, but not freeing any allocated
memory for existing write buffers.
Fixes #2026
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit 4bf086005fe5ebcda5dc4d48ff701b41ab9b07f0)
Diffstat (limited to 'test/sslapitest.c')
-rw-r--r-- | test/sslapitest.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c index 90326d9f9d..01811bf7e6 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -101,8 +101,16 @@ static int execute_test_large_message(const SSL_METHOD *smeth, goto end; } - testresult = 1; + /* + * Calling SSL_clear() first is not required but this tests that SSL_clear() + * doesn't leak (when using enable-crypto-mdebug). + */ + if (!SSL_clear(serverssl)) { + printf("Unexpected failure from SSL_clear()\n"); + goto end; + } + testresult = 1; end: X509_free(chaincert); SSL_free(serverssl); |