[asterisk-commits] murf: trunk r123446 - /trunk/cdr/cdr_tds.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 17 15:00:36 CDT 2008


Author: murf
Date: Tue Jun 17 15:00:36 2008
New Revision: 123446

URL: http://svn.digium.com/view/asterisk?view=rev&rev=123446
Log:
This solves a crash in the cdr_tds module on 'stop gracefully', for situations where 'settings' is not set to a pointer

Modified:
    trunk/cdr/cdr_tds.c

Modified: trunk/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/trunk/cdr/cdr_tds.c?view=diff&rev=123446&r1=123445&r2=123446
==============================================================================
--- trunk/cdr/cdr_tds.c (original)
+++ trunk/cdr/cdr_tds.c Tue Jun 17 15:00:36 2008
@@ -291,6 +291,9 @@
 
 static int mssql_disconnect(void)
 {
+	if (!settings)
+		return 0;
+	
 	if (settings->tds) {
 		tds_free_socket(settings->tds);
 		settings->tds = NULL;
@@ -399,9 +402,12 @@
 
 static void cdr_tds_config_destroy(void)
 {
-	ast_mutex_destroy(&settings->lock);
-	ast_string_field_free_memory(settings);
-	ast_free(settings);	
+	if (settings)
+	{
+		ast_mutex_destroy(&settings->lock);
+		ast_string_field_free_memory(settings);
+		ast_free(settings);	
+	}
 }
 
 static int tds_unload_module(void)




More information about the asterisk-commits mailing list