You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2016/04/19 16:14:32 UTC

[trafficserver] branch master updated: TS-4046: Prevent memory leak of HTTP heap for server intercept case. This close #577.

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  5abf6ac   TS-4046: Prevent memory leak of HTTP heap for server intercept case. This close #577.
5abf6ac is described below

commit 5abf6aca383e34b5aa1c0e3248936d858806acbe
Author: Alan M. Carroll <so...@yahoo-inc.com>
AuthorDate: Mon Apr 18 10:14:24 2016 -0500

    TS-4046: Prevent memory leak of HTTP heap for server intercept case.
    This close #577.
---
 proxy/hdrs/HTTP.h          | 7 ++++---
 proxy/http/HttpTransact.cc | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/proxy/hdrs/HTTP.h b/proxy/hdrs/HTTP.h
index b32d3ef..878fc83 100644
--- a/proxy/hdrs/HTTP.h
+++ b/proxy/hdrs/HTTP.h
@@ -507,7 +507,7 @@ public:
   int valid() const;
 
   void create(HTTPType polarity, HdrHeap *heap = NULL);
-  void clear();
+  void destroy();
   void reset();
   void copy(const HTTPHdr *hdr);
   void copy_shallow(const HTTPHdr *hdr);
@@ -796,12 +796,13 @@ HTTPHdr::create(HTTPType polarity, HdrHeap *heap)
 }
 
 inline void
-HTTPHdr::clear()
+HTTPHdr::destroy()
 {
   if (m_http && m_http->m_polarity == HTTP_TYPE_REQUEST) {
     m_url_cached.clear();
   }
-  this->HdrHeapSDKHandle::clear();
+  // Removing the only pointers to this data therefore it needs to get cleaned up or leak.
+  this->HdrHeapSDKHandle::destroy();
   m_http = NULL;
   m_mime = NULL;
 }
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 87763b6..c3b345d 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -935,7 +935,7 @@ done:
     HTTP_INCREMENT_DYN_STAT(http_invalid_client_requests_stat);
     TRANSACT_RETURN(SM_ACTION_SEND_ERROR_CACHE_NOOP, NULL);
   } else {
-    s->hdr_info.client_response.clear(); // anything previously set is invalid from this point forward
+    s->hdr_info.client_response.destroy(); // anything previously set is invalid from this point forward
     DebugTxn("http_trans", "END HttpTransact::EndRemapRequest");
 
     if (s->is_upgrade_request && s->post_remap_upgrade_return_point) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].