[asterisk-dev] [Code Review]: Fix more res_jabber resource leaks

opticron reviewboard at asterisk.org
Wed Nov 23 10:25:29 CST 2011



> On Nov. 22, 2011, 1:59 p.m., mjordan wrote:
> > trunk/channels/chan_gtalk.c, line 1013
> > <https://reviewboard.asterisk.org/r/1553/diff/2/?file=21559#file21559line1013>
> >
> >     Rather then using buddy_unref, can't you just use:
> >     if (buddy) {
> >        ASTOBJ_UNREF(buddy, ast_aji_buddy_destroy);
> >     }

Done.


> On Nov. 22, 2011, 1:59 p.m., mjordan wrote:
> > trunk/channels/chan_jingle.c, line 761
> > <https://reviewboard.asterisk.org/r/1553/diff/2/?file=21560#file21560line761>
> >
> >     Same buddy / buddy_unref finding here

Done.


> On Nov. 22, 2011, 1:59 p.m., mjordan wrote:
> > trunk/res/res_jabber.c, line 4538
> > <https://reviewboard.asterisk.org/r/1553/diff/2/?file=21562#file21562line4538>
> >
> >     And here (although it is commented out)

This one is required because it's the difference between finding the buddy in a container that needs to be unreffed and creating a new one that needs to be linked into the container and not unreffed.


- opticron


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1553/#review4842
-----------------------------------------------------------


On Nov. 23, 2011, 10:25 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1553/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2011, 10:25 a.m.)
> 
> 
> Review request for Asterisk Developers and jrose.
> 
> 
> Summary
> -------
> 
> There are many resource leaks inside res_jabber caused by uses of ASTOBJ_CONTAINER_FIND without a corresponding UNREF.  This fixes all the instances I saw and additionally fixes aji_client and aji_buddy leaks into chan_gtalk and chan_jingle.
> 
> 
> Diffs
> -----
> 
>   trunk/channels/chan_gtalk.c 345734 
>   trunk/channels/chan_jingle.c 345734 
>   trunk/include/asterisk/jabber.h 345734 
>   trunk/res/res_jabber.c 345734 
> 
> Diff: https://reviewboard.asterisk.org/r/1553/diff
> 
> 
> Testing
> -------
> 
> Tested res_jabber via distributed devstate changes in conjunction with openfire XMPP server.
> 
> 
> Thanks,
> 
> opticron
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111123/5a5a1125/attachment-0001.htm>


More information about the asterisk-dev mailing list