[asterisk-dev] [Code Review] 4511: Audit ast_pjsip_rdata_get_endpoint() usage for ref leaks.

Mark Michelson reviewboard at asterisk.org
Thu Mar 19 17:52:37 CDT 2015


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

Ship it!



/branches/13/res/res_pjsip_messaging.c
<https://reviewboard.asterisk.org/r/4511/#comment25336>

    Incoming SIP requests have to match an endpoint, so I'd either switch this if statement to be an ast_assert() or add an ast_assert() in addition to the if check.


- Mark Michelson


On March 18, 2015, 3:04 a.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4511/
> -----------------------------------------------------------
> 
> (Updated March 18, 2015, 3:04 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Valgrind found some memory leaks associated with
> ast_pjsip_rdata_get_endpoint().  The leaks would manifest when sending
> responses to OPTIONS requests, processing MESSAGE requests, and
> res_pjsip supplements implementing the incoming_request callback.
> 
> * Fix ast_pjsip_rdata_get_endpoint() endpoint ref leaks in
> res/res_pjsip.c:supplement_on_rx_request(),
> res/res_pjsip/pjsip_options.c:send_options_response(),
> res/res_pjsip_messaging.c:rx_data_to_ast_msg(), and
> res/res_pjsip_messaging.c:send_response().
> 
> * Eliminated RAII_VAR() use with ast_pjsip_rdata_get_endpoint() in
> res/res_pjsip_nat.c:nat_on_rx_message().
> 
> * Fixed inconsistent but benign return value in
> res/res_pjsip/pjsip_options.c:options_on_rx_request().
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_pjsip_nat.c 433089 
>   /branches/13/res/res_pjsip_messaging.c 433089 
>   /branches/13/res/res_pjsip/pjsip_options.c 433089 
>   /branches/13/res/res_pjsip.c 433089 
> 
> Diff: https://reviewboard.asterisk.org/r/4511/diff/
> 
> 
> Testing
> -------
> 
> Added temporary logging messages to show that incoming OPTIONS and MESSAGE
> requests hit the code that leaked the endpoint object refs.
> 
> 
> Thanks,
> 
> rmudgett
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150319/1d3ea981/attachment-0001.html>


More information about the asterisk-dev mailing list