git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123446
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
static int mssql_disconnect(void)
{
+ if (!settings)
+ return 0;
+
if (settings->tds) {
tds_free_socket(settings->tds);
settings->tds = NULL;
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)