summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yangster <yanglu@google.com> 2017-11-06 09:34:01 -0800
committer Yangster <yanglu@google.com> 2017-11-06 11:38:30 -0800
commit8a0595f498c57b6ca2ad75ce649dc7ab60cc9f97 (patch)
tree7db8691cbe30365f2297242b9b58e710a91e7991
parenta7d81598b5cd7c12e97f64015c9f5e316eadaf13 (diff)
Fix the nullptr bug after move operation.
Test: passed Change-Id: I1433b59ffe8fef1b26c424a535c30a4d1e15dff2
-rw-r--r--cmds/statsd/src/metrics/CountMetricProducer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds/statsd/src/metrics/CountMetricProducer.cpp b/cmds/statsd/src/metrics/CountMetricProducer.cpp
index 71cb7717d2d7..6f5db5178af0 100644
--- a/cmds/statsd/src/metrics/CountMetricProducer.cpp
+++ b/cmds/statsd/src/metrics/CountMetricProducer.cpp
@@ -248,8 +248,8 @@ void CountMetricProducer::flushCounterIfNeeded(const uint64_t eventTimeNs) {
proto->write(FIELD_TYPE_INT64 | FIELD_ID_COUNT, (long long)counter.second);
auto& bucketList = mPastBucketProtos[counter.first];
- bucketList.push_back(std::move(proto));
mByteSize += proto->size();
+ bucketList.push_back(std::move(proto));
VLOG("metric %lld, dump key value: %s -> %d", mMetric.metric_id(), counter.first.c_str(),
counter.second);