[asterisk-dev] [Code Review] Fix memory leaks in cel_pgsql

jrose reviewboard at asterisk.org
Thu Dec 22 15:54:32 CST 2011


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

Ship it!


Looks pretty harmless.

- jrose


On Dec. 15, 2011, 5:11 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1624/
> -----------------------------------------------------------
> 
> (Updated Dec. 15, 2011, 5:11 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> There were a number of issues in cel_pgsql's pgsql_log method.
> * If either sql or sql2 (both ast_str structs) could not be allocated, the method would return while the pgsql_lock was still locked
> * If the execution of the log statement succeeded, the sql and sql2 ast_str structs were never free'd
> * Reconnections were logged as ERRORs, etc.
> 
> This patch does some cleanup in pgsql_log to better handle the resource cleanup at the end of the method and to make better use of WARNING and NOTICEs where appropriate.
> 
> 
> This addresses bug ASTERISK-18879.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18879
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/cel/cel_pgsql.c 347950 
> 
> Diff: https://reviewboard.asterisk.org/r/1624/diff
> 
> 
> Testing
> -------
> 
> Tested using CEL with postgresql.  Tested that memory leaks did not occur when a record could not be inserted, as well as when a record was inserted.
> 
> 
> Thanks,
> 
> Matt
> 
>

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


More information about the asterisk-dev mailing list