This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/40712] locale(const locale&, const char*, locale::category) can create broken locale



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]