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
1.6.1
Steve Murphy 17 years ago
parent 5aeb6a6cbb
commit c23e5fea96

@ -291,6 +291,9 @@ static void get_date(char *dateField, struct timeval tv)
static int mssql_disconnect(void)
{
if (!settings)
return 0;
if (settings->tds) {
tds_free_socket(settings->tds);
settings->tds = NULL;
@ -399,9 +402,12 @@ connect_fail:
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)

Loading…
Cancel
Save