commit | 1aa00024fa28dd9772acc8ce22f1f6db12fd9622 | [log] [tgz] |
---|---|---|
author | Yao Chen <yaochen@google.com> | Wed Mar 21 17:04:34 2018 -0700 |
committer | Yao Chen <yaochen@google.com> | Wed Mar 21 17:04:34 2018 -0700 |
tree | c045445c8d090616e5117136c8b59f42b9bcabca | |
parent | 86259365d466332f072f29b8be5ccb5bca863a92 [diff] |
Fix the heap-after-use in DurationAnomalyTracker Bug: 74531081 Test: cts Change-Id: I21a50944a119b7576c76fd25fae23b9c2d8d96ab
diff --git a/cmds/statsd/src/anomaly/DurationAnomalyTracker.cpp b/cmds/statsd/src/anomaly/DurationAnomalyTracker.cpp index d85157c..79067eb 100644 --- a/cmds/statsd/src/anomaly/DurationAnomalyTracker.cpp +++ b/cmds/statsd/src/anomaly/DurationAnomalyTracker.cpp
@@ -68,10 +68,10 @@ if (itr->second != nullptr && timestampNs >= NS_PER_SEC * itr->second->timestampSec) { declareAnomaly(timestampNs, dimensionKey); } - mAlarms.erase(dimensionKey); if (mAlarmMonitor != nullptr) { mAlarmMonitor->remove(itr->second); } + mAlarms.erase(dimensionKey); } void DurationAnomalyTracker::cancelAllAlarms() {