This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: GCC Bugzilla Bug 24025
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Howard Hinnant <hhinnant at apple dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 04 Nov 2005 11:26:34 +0100
- Subject: Re: GCC Bugzilla Bug 24025
- References: <FDA01765-2D05-485D-827A-242389764E19@apple.com>
Hi,
> --- libstdc++-v3/libsupc++/eh_globals.cc (revision 106370)
> +++ libstdc++-v3/libsupc++/eh_globals.cc (working copy)
> @@ -115,7 +115,10 @@
> if ((g = (__cxa_eh_globals *)
> std::malloc (sizeof (__cxa_eh_globals))) == 0
> || __gthread_setspecific (globals_key, (void *) g) != 0)
> - std::terminate ();
> + {
> + std::free(g);
> + return &globals_static;
> + }
A general comment: irrespective of the meaning of global_static and the
substance of the issue, it seems to me that if malloc returns zero and
the conditional is early true, we have nothing to free...
Paolo.