Repository: trafficserver
Updated Branches:
  refs/heads/5.2.x 07a2f9067 -> 0be68b86f


[TS-3257]: Fix ssl handshake buffer memory leak introduced in TS-3006


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

Branch: refs/heads/5.2.x
Commit: a4b492cdd3ac5331736c448ea914bc9a9fe393b9
Parents: 07a2f90
Author: Sudheer Vinukonda <[email protected]>
Authored: Tue Dec 23 15:35:38 2014 +0000
Committer: Leif Hedstrom <[email protected]>
Committed: Tue Dec 23 09:54:17 2014 -0700

----------------------------------------------------------------------
 iocore/net/P_SSLNetVConnection.h | 13 +++++++++----
 iocore/net/SSLNetVConnection.cc  |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a4b492cd/iocore/net/P_SSLNetVConnection.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_SSLNetVConnection.h b/iocore/net/P_SSLNetVConnection.h
index c481c8b..77a3034 100644
--- a/iocore/net/P_SSLNetVConnection.h
+++ b/iocore/net/P_SSLNetVConnection.h
@@ -155,10 +155,15 @@ public:
     this->handShakeHolder = this->handShakeReader->clone();
   }
   void free_handshake_buffers() {
-
-    this->handShakeReader->dealloc();
-    this->handShakeHolder->dealloc();
-    free_MIOBuffer(this->handShakeBuffer);
+    if (this->handShakeReader) {
+      this->handShakeReader->dealloc();
+    }
+    if (this->handShakeHolder) {
+      this->handShakeHolder->dealloc();
+    }
+    if (this->handShakeBuffer) {
+      free_MIOBuffer(this->handShakeBuffer);
+    }
     this->handShakeReader = NULL;
     this->handShakeHolder = NULL;
     this->handShakeBuffer = NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a4b492cd/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 871c5a0..1c63002 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -815,6 +815,7 @@ SSLNetVConnection::free(EThread * t) {
   hookOpRequested = TS_SSL_HOOK_OP_DEFAULT;
   npnSet = NULL;
   npnEndpoint= NULL;
+  free_handshake_buffers();
 
   if (from_accept_thread) {
     sslNetVCAllocator.free(this);

Reply via email to