[svn-commits] tilghman: branch 1.6.0 r131754 - in /branches/1.6.0: ./ res/res_config_sqlite.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 17 13:37:22 CDT 2008


Author: tilghman
Date: Thu Jul 17 13:37:22 2008
New Revision: 131754

URL: http://svn.digium.com/view/asterisk?view=rev&rev=131754
Log:
Merged revisions 131753 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r131753 | tilghman | 2008-07-17 13:36:34 -0500 (Thu, 17 Jul 2008) | 6 lines

Fix memory leaks
(closes issue #13099)
 Reported by: gknispel_proformatique
 Patches: 
       res_config_sqlite_leak_on_error.patch uploaded by gknispel (license 261)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_config_sqlite.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_config_sqlite.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_config_sqlite.c?view=diff&rev=131754&r1=131753&r2=131754
==============================================================================
--- branches/1.6.0/res/res_config_sqlite.c (original)
+++ branches/1.6.0/res/res_config_sqlite.c Thu Jul 17 13:37:22 2008
@@ -1175,6 +1175,7 @@
 
 	if (!(tmp_str = sqlite_mprintf("%s WHERE %q = '%q';", query, keyfield, entity))) {
 		ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+		sqlite_freemem(query);
 		return -1;
 	}
 
@@ -1235,6 +1236,7 @@
 		}
 		if (!tmp_keys) {
 			ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+			sqlite_freemem(tmp_vals);
 			ast_free(params);
 			ast_free(vals);
 			return -1;
@@ -1248,6 +1250,7 @@
 		}
 		if (!tmp_vals) {
 			ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+			sqlite_freemem(tmp_keys);
 			ast_free(params);
 			ast_free(vals);
 			return -1;
@@ -1263,6 +1266,8 @@
 
 	if (!(tmp_str = sqlite_mprintf(QUERY, table, tmp_keys, tmp_vals))) {
 		ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+		sqlite_freemem(tmp_keys);
+		sqlite_freemem(tmp_vals);
 		return -1;
 	}
 
@@ -1342,6 +1347,7 @@
 	ast_free(vals);
 	if (!(tmp_str = sqlite_mprintf("%s %q = '%q';", query, keyfield, entity))) {
 		ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+		sqlite_freemem(query);
 		return -1;
 	}
 	sqlite_freemem(query);




More information about the svn-commits mailing list