re PR libstdc++/12352 (Exception safety problems in src/localename.cc)
authorPaolo Carlini <pcarlini@unitus.it>
Fri, 26 Sep 2003 00:22:01 +0000 (02:22 +0200)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 26 Sep 2003 00:22:01 +0000 (00:22 +0000)
commit91675f9d250dc14fda5c708ca86afd77a16b78bb
treed30431ba3f6f30116cd7cdf6d5917466fb5bd031
parent81a1dd18722933060d68626285e0fbc188846718
re PR libstdc++/12352 (Exception safety problems in src/localename.cc)

2003-09-25  Paolo Carlini  <pcarlini@unitus.it>

PR libstdc++/12352
* src/localename.cc (locale::_Impl::_Impl(const _Impl&,
size_t)): Don't leak if memory allocations for _M_facets,
_M_caches, and _M_names fail.
(locale::_Impl::_Impl(const char*, size_t)): Ditto.
(locale::_Impl::_M_replace_categories(const _Impl*,
category)): Ditto.
(locale::_Impl::_M_install_facet(const locale::id*,
const facet*)): Ditto.
* include/bits/locale_classes.h (locale::locale(const locale&,
_Facet*)): Don't leak memory.
* testsuite/22_locale/locale/cons/12352.cc: New, from the PR.

* src/localename.cc (locale::_Impl::_Impl(facet**, size_t,
bool)): Qualify with std:: strcpy, tweak.
* include/bits/locale_classes.h
(locale::_Impl::_M_check_same_name): Qualify strcmp.

From-SVN: r71808
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_classes.h
libstdc++-v3/src/localename.cc
libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc [new file with mode: 0644]