[Patch] Fix libstdc++/12352

Pétur Runólfsson peturr02@ru.is
Fri Sep 26 12:20:00 GMT 2003


There still appear to be memory leaks in the constructor

  locale::_Impl::
  _Impl(const char* __s, size_t __refs) 
  : _M_references(__refs), _M_facets_size(_GLIBCXX_NUM_FACETS)

At least, __cloc appears to be leaked if an exception is thrown,
and if exceptions are thrown from the lines that look like

    _M_init_facet(new std::collate<char>(__cloc));

then all memory allocated up to that point is leaked.

This should be detectable with the testcase I attached to the PR
if the outer loop is run often enough.

Petur



More information about the Libstdc++ mailing list