[Bug other/80048] New: gcc/sese.c: PVS-Studio: Improper Release of Memory Before Removing Last Reference (CWE-401)
khandeliants at viva64 dot com
gcc-bugzilla@gcc.gnu.org
Wed Mar 15 14:49:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80048
Bug ID: 80048
Summary: gcc/sese.c: PVS-Studio: Improper Release of Memory
Before Removing Last Reference (CWE-401)
Product: gcc
Version: 7.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: khandeliants at viva64 dot com
Target Milestone: ---
We have found a weakness (CWE-401) using PVS-Studio tool. PVS-Studio is a
static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/
Analyzer warning: V625 Consider inspecting the 'for' operator. Initial and
final values of the iterator are the same. sese.c 201
void free_sese_info (sese_info_p region)
{
region->params.release ();
region->loop_nest.release ();
for (rename_map_t::iterator it = region->rename_map->begin();
it != region->rename_map->begin (); ++it) // <=
(*it).second.release();
....
}
More information about the Gcc-bugs
mailing list