sippy / rtpproxy

The RTPproxy is a high-performance software proxy for RTP streams that can work together with Sippy B2BUA, Kamailio, OpenSIPS and SER.
http://rtpproxy.org
BSD 2-Clause "Simplified" License
417 stars 114 forks source link

Memory leak in `rtpp_cmd_rcache_insert` function #148

Closed hovhannes-96 closed 1 year ago

hovhannes-96 commented 1 year ago

The memory leak is found by a static analyzer developed at CAST ( https://www.linkedin.com/company/cast-center/).

In src/rtpp_command_rcache.c call of rtpp_rzmalloc allocates and returns dynamic memory which is not freed if the rep->reply isn't a NULL pointer.

sobomax commented 1 year ago

Hi, @hovhannes-96, I am pretty sure this report is a false-positive. The allocated memory is freed in function rtpp_cmd_rcache_entry_free() once the cache entry is disposed of on timer. The rtpproxy includes built-in zero-tolerance malloc checker, that we run on all of our tests covering 90% of the relevant code. But I suppose you guys are testing your static analyzer.

Please provide some logs explaining the scenario that allegedly triggers the issue and re-open if you feel this is actually an issue. Thanks!