This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57510] initializer_list memory leak
- From: "tavianator at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Dec 2014 21:03:28 +0000
- Subject: [Bug c++/57510] initializer_list memory leak
- Auto-submitted: auto-generated
- References: <bug-57510-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57510
--- Comment #4 from Tavian Barnes <tavianator at gmail dot com> ---
I have a testing tool that automatically inserts operator new failures, to help
test exception safety and check for leaks. This bug causes all kinds of
spurious failures that I have to work around, since anything like this
vector<string> vec = {"some", "strings"};
leaks memory if the second string constructor fails. Usually it can be worked
around like this
string arr[] = {"some", "strings"};
but it's still quite annoying.
If someone can point me in the right direction or give an outline of how to fix
this bug, I'm happy to try and write up a patch myself. Thanks!