[svn-commits] mjordan: trunk r372176 - in /trunk: ./ cel/cel_pgsql.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 4 21:26:56 CDT 2012


Author: mjordan
Date: Tue Sep  4 21:26:54 2012
New Revision: 372176

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=372176
Log:
Fix memory leak when CEL is successfully written to PostgreSQL database

PQClear is not called when the result object of a call to PQExec has a
status of PGRES_COMMAND_OK.  Interestingly enough, the off nominal case was
handled properly, so this memory leak only occurred when CEL records were
successfully written.

This patch properly clears the result in the nominal code path.

(closes issue ASTERISK-19991)
Reported by: Etienne Lessard
Tested by: Etienne Lessard
patches:
  mem_leak_cel_pgsql.patch uploaded by Etienne Lessard (license #6394)
........

Merged revisions 372158 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 372165 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 372175 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/cel/cel_pgsql.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/cel/cel_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/trunk/cel/cel_pgsql.c?view=diff&rev=372176&r1=372175&r2=372176
==============================================================================
--- trunk/cel/cel_pgsql.c (original)
+++ trunk/cel/cel_pgsql.c Tue Sep  4 21:26:54 2012
@@ -332,6 +332,7 @@
 			PQclear(result);
 			goto ast_log_cleanup;
 		}
+		PQclear(result);
 
 ast_log_cleanup:
 		ast_free(sql);




More information about the svn-commits mailing list