trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [1/2] trafficserver git commit: TS-3617 cache_promote leaks the URL string
Date Mon, 18 May 2015 22:03:43 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 79fd950d0 -> 1c6f986ca


TS-3617 cache_promote leaks the URL string


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

Branch: refs/heads/master
Commit: 21141a2e6586faabcd68d0c6eb7c5e47c3a53117
Parents: 79fd950
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Mon May 18 16:02:32 2015 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Mon May 18 16:02:32 2015 -0600

----------------------------------------------------------------------
 plugins/experimental/cache_promote/cache_promote.cc | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/21141a2e/plugins/experimental/cache_promote/cache_promote.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/cache_promote/cache_promote.cc b/plugins/experimental/cache_promote/cache_promote.cc
index 6b05882..bb49bcd 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -232,8 +232,14 @@ public:
     char *url = TSHttpTxnEffectiveUrlStringGet(txnp, &url_len);
     bool ret = false;
 
+    // Generally shouldn't happen ...
+    if (!url) {
+      return false;
+    }
+
     TSDebug(PLUGIN_NAME, "LRUPolicy::doPromote(%.*s ...)", url_len > 30 ? 30 : url_len,
url);
     hash.init(url, url_len);
+    TSfree(url);
 
     // We have to hold the lock across all list and hash access / updates
     TSMutexLock(_lock);


Mime
View raw message