[asterisk-dev] [Code Review] 3119: res_ari: Fix memory leaks.

Joshua Colp reviewboard at asterisk.org
Sun Jan 12 16:23:52 CST 2014


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

(Updated Jan. 12, 2014, 10:23 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Bugs: ASTERISK-23128
    https://issues.asterisk.org/jira/browse/ASTERISK-23128


Repository: Asterisk


Description
-------

This change fixes a few memory leaks in the res_ari module:

1. The documentation stated that the JSON message passed to ast_ari_response_ok would have its reference stolen. This did not actually occur. I've changed the code to match the documentation and changed callers accordingly.

2. I've also updated the ast_ari_response_created function to have the same behavior.

3. HTTP response headers were never freed.

4. The variable list for wildcard paths was never freed.


Diffs
-----

  /branches/12/res/res_ari.c 405265 
  /branches/12/res/ari/resource_recordings.c 405265 
  /branches/12/res/ari/resource_playbacks.c 405265 
  /branches/12/res/ari/resource_endpoints.c 405265 
  /branches/12/res/ari/resource_device_states.c 405265 
  /branches/12/res/ari/resource_channels.c 405265 
  /branches/12/res/ari/resource_bridges.c 405265 
  /branches/12/res/ari/resource_applications.c 405265 
  /branches/12/include/asterisk/ari.h 405265 

Diff: https://reviewboard.asterisk.org/r/3119/diff/


Testing
-------

Ran under valgrind and invoked some ARI operations which cover the various fixed cases. Stopped, confirmed output showed no leaks in ARI. I also ran with MALLOC_DEBUG enabled and did a "memory show summary".


Thanks,

Joshua Colp

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


More information about the asterisk-dev mailing list