From 2e47aedf8618a170154f63abfc21d90e7f5f3985 Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Tue, 1 Sep 2020 15:52:18 +0000 Subject: [PATCH] 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 --- usr.sbin/pmc/cmd_pmc_summary.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmc/cmd_pmc_summary.cc b/usr.sbin/pmc/cmd_pmc_summary.cc index 8eb53eccf0cf..69ddb523d50a 100644 --- a/usr.sbin/pmc/cmd_pmc_summary.cc +++ b/usr.sbin/pmc/cmd_pmc_summary.cc @@ -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; }