[Live-devel] Memory leaks in DarwinInjector.cpp

eyal.b at mavix.com eyal.b at mavix.com
Thu Nov 1 09:30:57 PDT 2007


Hello,

            I have found a few memory leaks in the injector code.

1)  In the SubstreamDescriptor() constructor a variable called "rtpmapLine"
gets allocated but never freed.

2)  In setDestination() a MediaSession is created to help the created
RTSPClient to setup its sub-sessions. 

This session is closed on function exit, but this cause a leak as closing
the session do not free the sub-sessions' ID stings allocated by the
RTSPClient for its use.

These IDs are freed only by RTSPClient::teardownMediaSubsession() and
RTSPClient::teardownMediaSession().

I have chosen to keep the created session as part of the Injector, and "tear
down" its sub-sessions and close it in the Injector destructor.

Thus (plus closing sinks and sources) enabled me to start and stop the
Injector per request without causing memory leaks.

 

 

Attached is the revised DarwinInjector source file.

 

Eyal Beit-Halachmi



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20071101/080105d7/attachment-0001.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: DarwinInjector.cpp
Url: http://lists.live555.com/pipermail/live-devel/attachments/20071101/080105d7/attachment-0001.ksh 


More information about the live-devel mailing list