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

Matt Jordan reviewboard at asterisk.org
Thu Aug 8 13:28:23 CDT 2013


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

Ship it!


Ship It!

- Matt Jordan


On May 31, 2013, 8:43 a.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2580/
> -----------------------------------------------------------
> 
> (Updated May 31, 2013, 8:43 a.m.)
> 
> 
> 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/20130808/14ecd4c3/attachment.htm>


More information about the asterisk-dev mailing list