This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libstdc++ PATCH] Fix leak in _Rb_tree::_M_insert (stl_tree.h)
- From: Earl Chew <earl_chew at agilent dot com>
- To: Chris Jefferson <caj at cs dot york dot ac dot uk>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Feb 2005 10:08:20 -0800
- Subject: Re: [libstdc++ PATCH] Fix leak in _Rb_tree::_M_insert (stl_tree.h)
- References: <421E8AE2.1050108@agilent.com> <421F29D9.402@cs.york.ac.uk>
Chris Jefferson wrote:
I apologise if I'm saying something really stupid, but from my looking
at the source code to stl_tree.h, it looks like _M_create_node just
allocates memory and doesn't actually do any tree based things.
Therefore why not just delay declaring the _Link_type until after the
__insert_left initalisation? Then there is no need for a try{...}catch{...}
That's a great idea.
I'll re-run the test and post the results.
Earl