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

Joshua Colp reviewboard at asterisk.org
Thu Jan 9 17:34:35 CST 2014


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

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/20140109/284aba5f/attachment.html>


More information about the asterisk-dev mailing list