[asterisk-dev] [Code Review] Add channel locking around datastore accesses in func_odbc.c.

Tilghman Lesher reviewboard at asterisk.org
Mon Jan 23 15:12:13 CST 2012


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


I disagree with your diagnosis of fixing a potential memory leak.  Since this module doesn't allocate UIDs, it would never be allocated, and thus there's no potential for a memory leak.  Fixing up to use an established central API is fine, though.


/branches/1.8/funcs/func_odbc.c
<https://reviewboard.asterisk.org/r/1687/#comment9825>

    Probably shouldn't unlock until the second variable is also set.


- Tilghman


On Jan. 23, 2012, 2:14 p.m., rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1687/
> -----------------------------------------------------------
> 
> (Updated Jan. 23, 2012, 2:14 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Accessing the channel datastore list without first locking the channel is bad.
> 
> Adds missing locking around the channel datastore accesses in func_odbc.c.
> 
> * Fixed a potential memory leak when an existing datastore is manually destroyed by inline code instead of calling ast_datastore_free().
> 
> 
> This addresses bug ASTERISK-17948.
>     https://issues.asterisk.org/jira/browse/ASTERISK-17948
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/funcs/func_odbc.c 352199 
> 
> Diff: https://reviewboard.asterisk.org/r/1687/diff
> 
> 
> Testing
> -------
> 
> It compiles. :)
> 
> 
> Thanks,
> 
> rmudgett
> 
>

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


More information about the asterisk-dev mailing list