This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36819] New: memleak in split_quote_chain
- From: "wuhui1973 at 21cn dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jul 2008 04:22:11 -0000
- Subject: [Bug c++/36819] New: memleak in split_quote_chain
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The definition of the function is in c-inpath.c as following.
void
split_quote_chain (void)
{
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
heads[BRACKET] = NULL;
tails[BRACKET] = NULL;
/* This is NOT redundant. */
quote_ignores_source_dir = true;
}
The elements in heads and tails point to the head and tail of certain list, and
the items in these lists are xmalloc in add_path. For above operation, memory
allocated for QUOTE list is leaked. Seems should invoke free_path first to
release the resource before the assignment.
This leakage will happen if we use -I- switch!
--
Summary: memleak in split_quote_chain
Product: gcc
Version: 3.4.6
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wuhui1973 at 21cn dot com
GCC build triplet: i686-dell-linux
GCC host triplet: i686-dell-linux
GCC target triplet: i686-dell-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36819