From 61c81999bfd6edc4fa414bba2acdfa502fbf07d4 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 17 Mar 2017 11:03:32 +0000 Subject: [PATCH] re PR tree-optimization/80048 (gcc/sese.c: PVS-Studio: Improper Release of Memory Before Removing Last Reference (CWE-401)) 2017-03-17 Richard Biener PR tree-optimization/80048 * sese.c (free_sese_info): Properly release rename_map and copied_bb_map elements. From-SVN: r246217 --- gcc/ChangeLog | 6 ++++++ gcc/sese.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0ed5ce3c57..925709bdab7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-17 Richard Biener + + PR tree-optimization/80048 + * sese.c (free_sese_info): Properly release rename_map and + copied_bb_map elements. + 2017-03-16 Alexandre Oliva * gimple-ssa-store-merging.c (struct imm_store_chain_info): diff --git a/gcc/sese.c b/gcc/sese.c index ed0e8fb9734..3279eadd12e 100644 --- a/gcc/sese.c +++ b/gcc/sese.c @@ -199,11 +199,11 @@ free_sese_info (sese_info_p region) region->loop_nest.release (); for (rename_map_t::iterator it = region->rename_map->begin (); - it != region->rename_map->begin (); ++it) + it != region->rename_map->end (); ++it) (*it).second.release (); for (bb_map_t::iterator it = region->copied_bb_map->begin (); - it != region->copied_bb_map->begin (); ++it) + it != region->copied_bb_map->end (); ++it) (*it).second.release (); delete region->rename_map; -- 2.30.2