mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
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
This commit is contained in:
@@ -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:
|
|||||||
|
|
||||||
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)
|
||||||
|
Reference in New Issue
Block a user