Author: vangyzen
Date: Tue Sep  1 15:52:18 2020
New Revision: 365051
URL: https://svnweb.freebsd.org/changeset/base/365051

Log:
  pmc: Fix freed internal location read
  
  Coverity detected this error.  The fix duplicates the assignment on line 171.
  
  Submitted by: bret_ketc...@dell.com
  Reported by:  Coverity
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon
  Differential Revision:        https://reviews.freebsd.org/D26227

Modified:
  head/usr.sbin/pmc/cmd_pmc_summary.cc

Modified: head/usr.sbin/pmc/cmd_pmc_summary.cc
==============================================================================
--- head/usr.sbin/pmc/cmd_pmc_summary.cc        Tue Sep  1 15:33:57 2020        
(r365050)
+++ head/usr.sbin/pmc/cmd_pmc_summary.cc        Tue Sep  1 15:52:18 2020        
(r365051)
@@ -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;
                        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to