]> granicus.if.org Git - apache/commitdiff
ab: Fix memory leak with -v2 and SSL.
authorStefan Fritsch <sf@apache.org>
Sun, 6 Jun 2010 19:25:54 +0000 (19:25 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 6 Jun 2010 19:25:54 +0000 (19:25 +0000)
PR: 49383
Submitted by: Pavel Kankovsky <peak argo troja mff cuni cz>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951932 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/ab.c

diff --git a/CHANGES b/CHANGES
index 7e698c3f13c2e190859a9fafa4ad134f2e59011a..6ad377c20fe2902159db8362985f4f13c86cf741 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,9 @@ Changes with Apache 2.3.6
      processing is completed, avoiding orphaned callback pointers.
      [Brett Gervasoni <brettg senseofsecurity.com>, Jeff Trawick]
 
+  *) ab: Fix memory leak with -v2 and SSL. PR 49383.
+     [Pavel Kankovsky <peak argo troja mff cuni cz>]
+
   *) core: Add per-module and per-directory loglevel configuration.
            Add some more trace logging.
      mod_rewrite: Replace RewriteLog/RewriteLogLevel with trace log levels.
index e4e76705da76ca31f9ff21d5f8c4689a8706c715..be9d9fc07f087350831b70ec86d5a1f39a1b57fd 100644 (file)
@@ -557,6 +557,7 @@ static int ssl_print_connection_info(BIO *bio, SSL *ssl)
 static void ssl_print_cert_info(BIO *bio, X509 *cert)
 {
     X509_NAME *dn;
+    EVP_PKEY *pk;
     char buf[1024];
 
     BIO_printf(bio, "Certificate version: %ld\n", X509_get_version(cert)+1);
@@ -568,8 +569,10 @@ static void ssl_print_cert_info(BIO *bio, X509 *cert)
     ASN1_UTCTIME_print(bio, X509_get_notAfter(cert));
     BIO_printf(bio,"\n");
 
+    pk = X509_get_pubkey(cert);
     BIO_printf(bio,"Public key is %d bits\n",
-               EVP_PKEY_bits(X509_get_pubkey(cert)));
+               EVP_PKEY_bits(pk));
+    EVP_PKEY_free(pk);
 
     dn = X509_get_issuer_name(cert);
     X509_NAME_oneline(dn, buf, sizeof(buf));