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

wdoekes reviewboard at asterisk.org
Fri May 31 03:43:39 CDT 2013


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

Review request for Asterisk Developers.


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/20130531/9204d1ec/attachment-0001.htm>


More information about the asterisk-dev mailing list