Skip to content
Snippets Groups Projects
Commit c23e5fea authored by Steve Murphy's avatar Steve Murphy
Browse files

This solves a crash in the cdr_tds module on 'stop gracefully', for situations...

This solves a crash in the cdr_tds module on 'stop gracefully', for situations where 'settings' is not set to a pointer

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 5aeb6a6c
No related branches found
No related tags found
No related merge requests found
...@@ -291,6 +291,9 @@ static void get_date(char *dateField, struct timeval tv) ...@@ -291,6 +291,9 @@ static void get_date(char *dateField, struct timeval tv)
static int mssql_disconnect(void) static int mssql_disconnect(void)
{ {
if (!settings)
return 0;
if (settings->tds) { if (settings->tds) {
tds_free_socket(settings->tds); tds_free_socket(settings->tds);
settings->tds = NULL; settings->tds = NULL;
...@@ -399,9 +402,12 @@ connect_fail: ...@@ -399,9 +402,12 @@ connect_fail:
static void cdr_tds_config_destroy(void) static void cdr_tds_config_destroy(void)
{ {
ast_mutex_destroy(&settings->lock); if (settings)
ast_string_field_free_memory(settings); {
ast_free(settings); ast_mutex_destroy(&settings->lock);
ast_string_field_free_memory(settings);
ast_free(settings);
}
} }
static int tds_unload_module(void) static int tds_unload_module(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment