[asterisk-dev] [Code Review] 4509: Audit ast_sockaddr_resolve() usage memory leaks.

Kevin Harwell reviewboard at asterisk.org
Tue Mar 17 14:31:05 CDT 2015


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

Ship it!


Ship It!

- Kevin Harwell


On March 17, 2015, 12:56 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4509/
> -----------------------------------------------------------
> 
> (Updated March 17, 2015, 12:56 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Valgrind found some memory leaks associated with ast_sockaddr_resolve().
> Most of the leaks had already been fixed by earlier memory leak hunt
> patches.  This patch performs an audit of ast_sockaddr_resolve() and found
> one more.
> 
> * Fix ast_sockaddr_resolve() memory leak in
> apps/app_externalivr.c:app_exec().
> 
> * Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
> parameter for safety so the pointer will never be uninitialized on return.
> The same goes for res/res_pjsip_acl.c:extract_contact_addr().
> 
> * Made functions that call ast_sockaddr_resolve() with RAII_VAR()
> controlling the addrs variable use ast_free instead of ast_free_ptr to
> provide better MALLOC_DEBUG information.
> 
> 
> This review is against v13 but a subset applies to v11.
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_pjsip_t38.c 433004 
>   /branches/13/res/res_pjsip_sdp_rtp.c 433004 
>   /branches/13/res/res_pjsip_acl.c 433004 
>   /branches/13/main/netsock2.c 433004 
>   /branches/13/apps/app_externalivr.c 433004 
> 
> Diff: https://reviewboard.asterisk.org/r/4509/diff/
> 
> 
> Testing
> -------
> 
> Compiling and code inspection.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150317/afab324a/attachment.html>


More information about the asterisk-dev mailing list