Re: [Boost-bugs] [Boost C++ Libraries] #3474: Memory leak due to exception safety issue

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3474: Memory leak due to exception safety issue
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-14 03:10:16


#3474: Memory leak due to exception safety issue
--------------------------------------+-------------------------------------
 Reporter: lee@… | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: system
  Version: Boost 1.35.0 | Severity: Problem
 Keywords: |
--------------------------------------+-------------------------------------
Changes (by marshall):

  * component: filesystem => system

Comment:

 As of boost 1.42.0, there are no calls to "FormatMessageA" in boost
 filesystem.
 There is similar code in the Boost.System library, though.
 Reassigning; Beman will squawk if I'm wrong.
 File: libs/system/src/error_code.cpp

 {{{

   std::string system_error_category::message( int ev ) const
   {
 # ifndef BOOST_NO_ANSI_APIS
     LPVOID lpMsgBuf;
     DWORD retval = ::FormatMessageA(
         FORMAT_MESSAGE_ALLOCATE_BUFFER |
         FORMAT_MESSAGE_FROM_SYSTEM |
         FORMAT_MESSAGE_IGNORE_INSERTS,
         NULL,
         ev,
         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
         (LPSTR) &lpMsgBuf,
         0,
         NULL
     );
     if (retval == 0)
         return std::string("Unknown error");

     std::string str( static_cast<LPCSTR>(lpMsgBuf) );
     ::LocalFree( lpMsgBuf ); // free the buffer
 # else // WinCE workaround
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3474#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC