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:12:25 +0000 |
commit | 4bf086005fe5ebcda5dc4d48ff701b41ab9b07f0 (patch) | |
tree | 5f4385dac976af613846f95f4dff3cf76c711d73 /test/sslapitest.c | |
parent | 82e089308bd9a7794a45f0fa3973d7659420fbd8 (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>
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 add38cf622..e370807bbc 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -100,8 +100,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); |