This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale
- From: "paolo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2009 22:58:23 -0000
- Subject: [Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale
- References: <bug-40712-16694@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from paolo at gcc dot gnu dot org 2009-07-18 22:58 -------
Subject: Bug 40712
Author: paolo
Date: Sat Jul 18 22:58:10 2009
New Revision: 149782
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149782
Log:
2009-07-18 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/40712
* config/locale/gnu/numeric_members.cc (numpunct<>::
_M_initialize_numpunct): Dynamically allocate _M_data->_M_grouping
and copy the langinfo data into it.
(numpunct<>::~numpunct): Free the allocated memory.
* config/locale/gnu/monetary_members.cc (moneypunct<>::
_M_initialize_moneypunct): Dynamically allocate _M_data->_M_grouping,
_M_data->_M_positive_sign, _M_data->_M_negative_sign,
_M_data->_M_curr_symbol.
(moneypunct<>::~moneypunct): Free the allocated memory.
* testsuite/22_locale/moneypunct/40712.cc: New.
* include/bits/locale_facets.tcc (__numpunct_cache<>::_M_cache):
Do not leak memory if new throws.
* include/bits/locale_facets_nonio.tcc
(__moneypunct_cache<>::_M_cache): Likewise.
Added:
trunk/libstdc++-v3/testsuite/22_locale/moneypunct/40712.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/config/locale/gnu/monetary_members.cc
trunk/libstdc++-v3/config/locale/gnu/numeric_members.cc
trunk/libstdc++-v3/include/bits/locale_facets.tcc
trunk/libstdc++-v3/include/bits/locale_facets_nonio.tcc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40712