trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject git commit: Fix memory leak in SSLCertlLookup
Date Thu, 25 Sep 2014 20:03:03 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 86ec39c05 -> 119619772


Fix memory leak in SSLCertlLookup


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/11961977
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/11961977
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/11961977

Branch: refs/heads/master
Commit: 1196197727b14cd6fa6a434b90310170672e1a55
Parents: 86ec39c
Author: Alan M. Carroll <amc@apache.org>
Authored: Thu Sep 25 15:01:24 2014 -0500
Committer: Alan M. Carroll <amc@apache.org>
Committed: Thu Sep 25 15:01:24 2014 -0500

----------------------------------------------------------------------
 iocore/net/SSLCertLookup.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/11961977/iocore/net/SSLCertLookup.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index 7ae3d8c..c7ba9ee 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -293,19 +293,19 @@ SSLContextStorage::insert(const char* name, int idx)
       // We fail to insert, so the longest wildcard match search should return the full match
value.
       found = this->wildcards.Search(reversed);
       // Fail even if we are reinserting the exact same value
-      // Otherwise we cannot detect and recover from a doupble insert
+      // Otherwise we cannot detect and recover from a double insert
       // into the references array
-      //if (found != NULL && found->idx != idx) {
       if (found != NULL) {
         Warning("previously indexed wildcard certificate for '%s' as '%s', cannot index it
with SSL_CTX #%d now",
             name, reversed, idx);
       }
       idx = -1;
+    } else {
+      ref.release(); // it's the hands of the Trie now, forget it and move on.
     }
 
     Debug("ssl", "%s wildcard certificate for '%s' as '%s' with SSL_CTX %p [%d]",
       idx >= 0 ? "index" : "failed to index", name, reversed, this->ctx_store[(*ref).idx].ctx,
(*ref).idx);
-    ref.release();
   } else {
     InkHashTableValue value;
 


Mime
View raw message