<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> I
have found a few memory leaks in the injector code.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>1) In the SubstreamDescriptor()
constructor a variable called “rtpmapLine” gets allocated but never
freed.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>2) In setDestination() a
MediaSession is created to help the created RTSPClient to setup its
sub-sessions. <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>These IDs are freed only by </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>RTSPClient::teardownMediaSubsession()
and RTSPClient::teardownMediaSession()</span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>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.<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Thus (plus closing sinks and
sources) enabled me to start and stop the Injector per request without causing
memory leaks.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Attached is the revised DarwinInjector source file.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Eyal Beit-Halachmi<br>
<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>