[asterisk-commits] tilghman: trunk r179361 - /trunk/cdr/cdr_sqlite3_custom.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 2 11:18:51 CST 2009


Author: tilghman
Date: Mon Mar  2 11:18:48 2009
New Revision: 179361

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179361
Log:
Backport 1.6.0 fix to trunk (failsafe if db is not loaded)

Modified:
    trunk/cdr/cdr_sqlite3_custom.c

Modified: trunk/cdr/cdr_sqlite3_custom.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/cdr/cdr_sqlite3_custom.c?view=diff&rev=179361&r1=179360&r2=179361
==============================================================================
--- trunk/cdr/cdr_sqlite3_custom.c (original)
+++ trunk/cdr/cdr_sqlite3_custom.c Mon Mar  2 11:18:48 2009
@@ -239,6 +239,11 @@
 	char *sql = NULL;
 	struct ast_channel dummy = { 0, };
 	int count = 0;
+
+	if (db == NULL) {
+		/* Should not have loaded, but be failsafe. */
+		return 0;
+	}
 
 	{ /* Make it obvious that only sql should be used outside of this block */
 		char *escaped;




More information about the asterisk-commits mailing list