Index: src/counters.cc |
diff --git a/src/counters.cc b/src/counters.cc |
index 84568ac351fc696db2638d106f9d3b3fa02c9c41..c4e86460aa1140054a09f1f0abc0a1350e4054da 100644 |
--- a/src/counters.cc |
+++ b/src/counters.cc |
@@ -364,7 +364,7 @@ void RuntimeCallStats::Reset() { |
in_use_ = true; |
} |
-const char* RuntimeCallStats::Dump() { |
+std::string RuntimeCallStats::Dump() { |
buffer_.str(std::string()); |
buffer_.clear(); |
buffer_ << "{"; |
@@ -393,15 +393,8 @@ const char* RuntimeCallStats::Dump() { |
FOR_EACH_HANDLER_COUNTER(DUMP_COUNTER) |
#undef DUMP_COUNTER |
buffer_ << "\"END\":[]}"; |
- const std::string& buffer_str = buffer_.str(); |
- size_t length = buffer_str.size(); |
- if (length > len_) { |
- buffer_c_str_.reset(new char[length + 1]); |
- len_ = length; |
- } |
- strncpy(buffer_c_str_.get(), buffer_str.c_str(), length + 1); |
in_use_ = false; |
- return buffer_c_str_.get(); |
+ return buffer_.str(); |
} |
} // namespace internal |