pmc: Fix freed internal location read

Coverity detected this error.  The fix duplicates the assignment on line 171.

Submitted by:	bret_ketchum@dell.com
Reported by:	Coverity
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26227
This commit is contained in:
Eric van Gyzen 2020-09-01 15:52:18 +00:00
parent e26b9046a0
commit 2e47aedf86

View File

@ -156,7 +156,7 @@ pmc_summary_handler(int logfd, int k, bool do_full)
auto rate = ratemap[kv.first];
std::cout << "idx: " << kv.first << " name: " << name << " rate: " << rate << std::endl;
while (!kv.second.empty()) {
auto &val = kv.second.back();
auto val = kv.second.back();
kv.second.pop_back();
std::cout << val.second << ": " << val.first << std::endl;
}