[asterisk-dev] [Code Review] 2580: Consistent memory allocation by ast_bt_get_symbols

svnbot reviewboard at asterisk.org
Thu Aug 8 15:14:31 CDT 2013


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

(Updated Aug. 8, 2013, 3:14 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 396427


Repository: Asterisk


Description
-------

ast_bt_get_symbols can return either an ast_malloc'd or a regular malloc'd list, depending on the value of BETTER_BACKTRACES.

The result was always free'd (not ast_free'd).

This patch:
 - copies the malloc'd list from backtrace_symbols into ast_malloc'd memory,
 - replaces the free's with ast_free's,
 - documents that the ast_bt_get_symbols return value should be freed.

Unsure whether to put it in 1.8, since ast_bt_get_symbols() might be used by an external module.


Diffs
-----

  /trunk/main/utils.c 390180 
  /trunk/main/logger.c 390180 
  /trunk/main/astobj2.c 390180 
  /trunk/include/asterisk/logger.h 390180 

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


Testing
-------

Compile tested only.


Thanks,

wdoekes

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


More information about the asterisk-dev mailing list