summaryrefslogtreecommitdiff
path: root/mysql-test/t/openssl_1.test
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-05-25 10:00:18 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-05-25 10:00:18 -0300
commit981ff94d801cfca8479dce5e6fdf6f14c75f47b7 (patch)
tree313e142b0d73e2db6283108c35e6937edefa7fdb /mysql-test/t/openssl_1.test
parent8fb82e3fe0887496876ba0058a741fca29c96c3b (diff)
downloadmariadb-git-981ff94d801cfca8479dce5e6fdf6f14c75f47b7.tar.gz
Bug#42158: leak: SSL_get_peer_certificate() doesn't have matching X509_free()
The problem is that the server failed to follow the rule that every X509 object retrieved using SSL_get_peer_certificate() must be explicitly freed by X509_free(). This caused a memory leak for builds linked against OpenSSL where the X509 object is reference counted -- improper counting will prevent the object from being destroyed once the session containing the peer certificate is freed. The solution is to explicitly free every X509 object used.
Diffstat (limited to 'mysql-test/t/openssl_1.test')
-rw-r--r--mysql-test/t/openssl_1.test13
1 files changed, 12 insertions, 1 deletions
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 240a977fdca..baa1603faab 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -238,7 +238,18 @@ DROP TABLE t1;
--enable_query_log
select 'is still running; no cipher request crashed the server' as result from dual;
-##
+#
+# Bug#42158: leak: SSL_get_peer_certificate() doesn't have matching X509_free()
+#
+
+GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
+FLUSH PRIVILEGES;
+connect(con1,localhost,bug42158,,,,,SSL);
+SHOW STATUS LIKE 'Ssl_cipher';
+disconnect con1;
+connection default;
+DROP USER bug42158@localhost;
+
--echo End of 5.1 tests
# Wait till we reached the initial number of concurrent sessions