[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] Fix memory leaks in cel_pgsql
From:       "jrose" <reviewboard () asterisk ! org>
Date:       2011-12-22 21:54:32
Message-ID: 20111222215432.19146.96134 () hotblack ! digium ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
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, th=
e method would return while the pgsql_lock was still locked
> * If the execution of the log statement succeeded, the sql and sql2 ast_s=
tr structs were never free'd
> * Reconnections were logged as ERRORs, etc.
> =

> This patch does some cleanup in pgsql_log to better handle the resource c=
leanup at the end of the method and to make better use of WARNING and NOTIC=
Es 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
> =

>


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1624/">https://reviewboard.asterisk.org/r/1624/</a>
  </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Looks pretty \
harmless.</pre>  <br />







<p>- jrose</p>


<br />
<p>On December 15th, 2011, 5:11 p.m., Matt Jordan wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Matt Jordan.</div>


<p style="color: grey;"><i>Updated Dec. 15, 2011, 5:11 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
                break-word;">There were a number of issues in cel_pgsql&#39;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&#39;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.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">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.</pre>  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18879">ASTERISK-18879</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/cel/cel_pgsql.c <span style="color: grey">(347950)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1624/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic