Subject: [Boost-bugs] [Boost C++ Libraries] #9027: Memory leaks in Lexer and Spirit classic
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-21 12:58:14
#9027: Memory leaks in Lexer and Spirit classic
-------------------------------------+---------------------
Reporter: apolukhin | Owner: djowel
Type: Patches | Status: new
Milestone: Boost 1.55.0 | Component: spirit
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+---------------------
In `boost/spirit/home/classic/tree/impl/tree_to_xml.ipp` you may find the
following code (line 71):
{{{
std::auto_ptr<wchar_t> result (new wchar_t[len+1]);
}}}
This will lead to memory leak (array myst be deallocated via `delete []`,
but `auto_ptr` calls `delete`).
To fix that issue include `<boost/scoped_array.hpp>` and use
`boost::scoped_array<wchar_t>` instead of `std::auto_ptr<wchar_t>`
Same error can be found in
`./boost/spirit/home/lex/lexer/lexertl/generate_static.hpp` at line 53.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9027> 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:13 UTC