[asterisk-dev] [svn-commits] mmichelson: branch 1.4 r202601 - /branches/1.4/channels/chan_sip.c

Mark Michelson mmichelson at digium.com
Tue Jun 23 13:09:40 CDT 2009


Olle E. Johansson wrote:
> 23 jun 2009 kl. 17.22 skrev SVN commits to the Digium repositories:
> 
>> Author: mmichelson
>> Date: Tue Jun 23 10:22:35 2009
>> New Revision: 202601
>>
>> URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=202601
>> Log:
>> Fix more memory leaks that may result if rtp is not successfully  
>> allocated.
> 
> 
> It certainly doesn't harm to close these, but I don't think they are  
> leaks, since we should clean it up in the destruction of the dialog  
> all the time. If we're not doing that, then that's a bug in itself.
> 
> /O
> 

You are partially correct. In trunk, 1.6.1, and 1.6.2, this cleanup is taken 
care of because the sip_pvt is an ao2 object. When the rtp allocation failures 
happen, we unref the sip_pvt and know that the __sip_destroy function will take 
care of all the potential leaks.

In 1.4 and 1.6.0, however, you'll notice that the action taken was to just free 
the sip_pvt (and a couple of allocated fields). The problem was that several 
allocations made earlier in the sip_alloc function were not being freed. It may 
be that a valid alternative to freeing all the necessary memory would be just to 
call __sip_destroy on the sip_pvt. What do you think?

Mark Michelson



More information about the asterisk-dev mailing list