You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2018/08/31 16:12:55 UTC
[trafficserver] branch 8.0.x updated: Log Collation - Memory leak
when more than one active host defined.
This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/8.0.x by this push:
new 937559d Log Collation - Memory leak when more than one active host defined.
937559d is described below
commit 937559d3dcb94176c5ece8efc8d0fe6ba95a09ac
Author: Peter Chou <pb...@labs.att.com>
AuthorDate: Mon Jul 30 23:35:37 2018 -0700
Log Collation - Memory leak when more than one active host defined.
When more than one active host is defined, there is a memory leak because LogHostList::preproc_and_try_delete() allocates one
LogBuffer reference per host but only destroys one reference at the end of the function. The reference increments and destroys
must be balanced to ensure that LogBuffers are deleted properly.
(cherry picked from commit 4a115df3d02db3ee50b2038f5c1cd4b12248b3b6)
---
proxy/logging/LogHost.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxy/logging/LogHost.cc b/proxy/logging/LogHost.cc
index 981bd12..2cffd68 100644
--- a/proxy/logging/LogHost.cc
+++ b/proxy/logging/LogHost.cc
@@ -404,14 +404,14 @@ int
LogHostList::preproc_and_try_delete(LogBuffer *lb)
{
int success = false;
- unsigned nr_host, nr;
+ unsigned nr;
bool need_orphan = true;
LogHost *available_host = nullptr;
ink_release_assert(lb->m_references == 0);
- nr_host = nr = count();
- ink_atomic_increment(&lb->m_references, nr_host);
+ nr = count();
+ ink_atomic_increment(&lb->m_references, 1);
for (LogHost *host = first(); host && nr; host = next(host)) {
LogHost *lh = host;