You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ni...@apache.org on 2015/08/31 19:08:40 UTC
trafficserver git commit: stream editor plugin: fix broken destructor.
Repository: trafficserver
Updated Branches:
refs/heads/master 8898b907f -> 7a1b150ac
stream editor plugin: fix broken destructor.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7a1b150a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7a1b150a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7a1b150a
Branch: refs/heads/master
Commit: 7a1b150acf0fc01dda9ad04feb6149debe8261cb
Parents: 8898b90
Author: Nick Kew <nk...@qualys.com>
Authored: Mon Aug 31 18:06:47 2015 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Mon Aug 31 18:06:47 2015 +0100
----------------------------------------------------------------------
.../experimental/stream_editor/stream_editor.cc | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7a1b150a/plugins/experimental/stream_editor/stream_editor.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/stream_editor/stream_editor.cc b/plugins/experimental/stream_editor/stream_editor.cc
index 56612d6..6ef6ae5 100644
--- a/plugins/experimental/stream_editor/stream_editor.cc
+++ b/plugins/experimental/stream_editor/stream_editor.cc
@@ -502,16 +502,17 @@ public:
rule_t(const rule_t &r) : scope(r.scope), priority(r.priority), from(r.from), to(r.to), refcount(r.refcount) { ++*refcount; }
~rule_t()
{
- if (!refcount || !--*refcount) {
- if (scope)
- delete scope;
- if (from)
- delete from;
- if (to)
- TSfree(to);
+ if (refcount) {
+ if (!--*refcount) {
+ if (scope)
+ delete scope;
+ if (from)
+ delete from;
+ if (to)
+ TSfree(to);
+ delete refcount;
+ }
}
- if (refcount)
- delete refcount;
}
bool