Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84876 - trunk/boost/asio/ssl/impl
From: chris_at_[hidden]
Date: 2013-06-22 08:45:33


Author: chris_kohlhoff
Date: 2013-06-22 08:45:33 EDT (Sat, 22 Jun 2013)
New Revision: 84876
URL: http://svn.boost.org/trac/boost/changeset/84876

Log:
Fix memory leak in ssl::rfc2818_verification class.

Text files modified:
   trunk/boost/asio/ssl/impl/rfc2818_verification.ipp | 10 ++++++++++
   1 files changed, 10 insertions(+), 0 deletions(-)

Modified: trunk/boost/asio/ssl/impl/rfc2818_verification.ipp
==============================================================================
--- trunk/boost/asio/ssl/impl/rfc2818_verification.ipp Sat Jun 22 08:44:53 2013 (r84875)
+++ trunk/boost/asio/ssl/impl/rfc2818_verification.ipp 2013-06-22 08:45:33 EDT (Sat, 22 Jun 2013) (r84876)
@@ -70,7 +70,10 @@
         const char* pattern = reinterpret_cast<const char*>(domain->data);
         std::size_t pattern_length = domain->length;
         if (match_pattern(pattern, pattern_length, host_.c_str()))
+ {
+ GENERAL_NAMES_free(gens);
           return true;
+ }
       }
     }
     else if (gen->type == GEN_IPADD && is_address)
@@ -82,17 +85,24 @@
         {
           ip::address_v4::bytes_type bytes = address.to_v4().to_bytes();
           if (memcmp(bytes.data(), ip_address->data, 4) == 0)
+ {
+ GENERAL_NAMES_free(gens);
             return true;
+ }
         }
         else if (address.is_v6() && ip_address->length == 16)
         {
           ip::address_v6::bytes_type bytes = address.to_v6().to_bytes();
           if (memcmp(bytes.data(), ip_address->data, 16) == 0)
+ {
+ GENERAL_NAMES_free(gens);
             return true;
+ }
         }
       }
     }
   }
+ GENERAL_NAMES_free(gens);
 
   // No match in the alternate names, so try the common names. We should only
   // use the "most specific" common name, which is the last one in the list.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk