[asterisk-commits] mjordan: branch 12 r403435 - /branches/12/res/res_config_sqlite.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 7 23:54:54 CST 2013


Author: mjordan
Date: Sat Dec  7 23:54:53 2013
New Revision: 403435

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403435
Log:
res_config_sqlite: Check for CDR unregistration failures

If the CDR unregistration fails due to an inflight CDR, the
res_config_sqlite module needs to bail on unloading itself. Otherwise,
the config could be unloaded (including the CDR table name) while the
CDR engine posts a CDR to the still registered backend, resulting in
a crash.

Modified:
    branches/12/res/res_config_sqlite.c

Modified: branches/12/res/res_config_sqlite.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_config_sqlite.c?view=diff&rev=403435&r1=403434&r2=403435
==============================================================================
--- branches/12/res/res_config_sqlite.c (original)
+++ branches/12/res/res_config_sqlite.c Sat Dec  7 23:54:53 2013
@@ -1627,11 +1627,13 @@
 
 static int unload_module(void)
 {
-	if (cli_status_registered)
+	if (cdr_registered && ast_cdr_unregister(RES_CONFIG_SQLITE_NAME)) {
+		return -1;
+	}
+
+	if (cli_status_registered) {
 		ast_cli_unregister_multiple(cli_status, ARRAY_LEN(cli_status));
-
-	if (cdr_registered)
-		ast_cdr_unregister(RES_CONFIG_SQLITE_NAME);
+	}
 
 	ast_config_engine_deregister(&sqlite_engine);
 




More information about the asterisk-commits mailing list