Opened 11 years ago
Closed 9 years ago
#6035 closed Support Requests (worksforme)
Klocwork warning found in statechart regarding inconsistent memory free
Reported by: | anonymous | Owned by: | Andreas Huber |
---|---|---|---|
Milestone: | To Be Determined | Component: | statechart |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | Cc: |
Description
FREE.INCONSISTENT : Memory pointed by 'pBase' is freed at this point, but this memory is not freed upon function exits at line(s) 93. :
inline void intrusive_ptr_release( const ::boost::statechart::event_base * pBase ) {
if ( pBase->release() ) {
::boost::statechart::detail::delete_helper::delete_object( pBase );
}
}
Path: C:\boost\boost\statechart\event_base.hpp Line: 91 Severity: Severe
Note:
See TracTickets
for help on using tickets.
This looks like a false positive. According to http://www.klocwork.com/products/documentation/current/Checkers:FREE.INCONSISTENT it seems that Klocwork will flag any function that frees memory conditionally. However, doing so is inevitable with reference counting.