Boost C++ Libraries: Ticket #6035: Klocwork warning found in statechart regarding inconsistent memory free https://svn.boost.org/trac10/ticket/6035 <p> FREE.INCONSISTENT : Memory pointed by 'pBase' is freed at this point, but this memory is not freed upon function exits at line(s) 93. : </p> <p> inline void intrusive_ptr_release( const ::boost::statechart::event_base * pBase ) { </p> <blockquote> <p> if ( pBase-&gt;release() ) { </p> <blockquote> <p> ::boost::statechart::detail::delete_helper::delete_object( pBase ); </p> </blockquote> <p> } </p> </blockquote> <p> } </p> <p> Path: C:\boost\boost\statechart\event_base.hpp Line: 91 Severity: Severe </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6035 Trac 1.4.3 Andreas Huber Sun, 09 Jun 2013 18:02:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6035#comment:1 https://svn.boost.org/trac10/ticket/6035#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">worksforme</span> </li> </ul> <p> This looks like a false positive. According to <a class="ext-link" href="http://www.klocwork.com/products/documentation/current/Checkers:FREE.INCONSISTENT"><span class="icon">​</span>http://www.klocwork.com/products/documentation/current/Checkers:FREE.INCONSISTENT</a> it seems that Klocwork will flag any function that frees memory conditionally. However, doing so is inevitable with reference counting. </p> Ticket