Boost C++ Libraries: Ticket #9027: Memory leaks in Lexer and Spirit classic https://svn.boost.org/trac10/ticket/9027 <p> In <code>boost/spirit/home/classic/tree/impl/tree_to_xml.ipp</code> you may find the following code (line 71): </p> <pre class="wiki"> std::auto_ptr&lt;wchar_t&gt; result (new wchar_t[len+1]); </pre><p> This will lead to memory leak (array myst be deallocated via <code>delete []</code>, but <code>auto_ptr</code> calls <code>delete</code>). </p> <p> To fix that issue include <code>&lt;boost/scoped_array.hpp&gt;</code> and use <code>boost::scoped_array&lt;wchar_t&gt;</code> instead of <code>std::auto_ptr&lt;wchar_t&gt;</code> </p> <p> Same error can be found in <code>./boost/spirit/home/lex/lexer/lexertl/generate_static.hpp</code> at line 53. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9027 Trac 1.4.3 Joel de Guzman Wed, 21 Aug 2013 13:34:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9027#comment:1 https://svn.boost.org/trac10/ticket/9027#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85415" title="Fixes #9027">[85415]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9027" title="#9027: Patches: Memory leaks in Lexer and Spirit classic (closed: fixed)">#9027</a> </p> Ticket Joel de Guzman Wed, 21 Aug 2013 13:34:51 GMT <link>https://svn.boost.org/trac10/ticket/9027#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9027#comment:2</guid> <description> <p> Good catch! Thanks for spotting! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Wed, 21 Aug 2013 14:09:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9027#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9027#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9027#comment:2" title="Comment 2">djowel</a>: </p> <blockquote class="citation"> <p> Good catch! Thanks for spotting! </p> </blockquote> <p> Thank the guys from <a class="ext-link" href="http://www.viva64.com/en/b/0208/"><span class="icon">​</span>PVS-Studio</a>. They've found it. </p> <p> P.S.: I've also reported all the other bugs from that article to library maintainers. </p> </description> <category>Ticket</category> </item> </channel> </rss>