mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 08:13:22 +00:00
fix some issues with crashing on unload, when it didn't completely load cleanly
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5619,10 +5619,13 @@ chanreg_failed:
|
|||||||
/*! XXX \todo Leaking anything allocated by reload_config() ... */
|
/*! XXX \todo Leaking anything allocated by reload_config() ... */
|
||||||
reload_failed:
|
reload_failed:
|
||||||
sched_context_destroy(sched);
|
sched_context_destroy(sched);
|
||||||
|
sched = NULL;
|
||||||
sched_failed:
|
sched_failed:
|
||||||
io_context_destroy(io);
|
io_context_destroy(io);
|
||||||
|
io = NULL;
|
||||||
io_failed:
|
io_failed:
|
||||||
free(buff);
|
free(buff);
|
||||||
|
buff = NULL;
|
||||||
buff_failed:
|
buff_failed:
|
||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
@@ -5630,7 +5633,8 @@ buff_failed:
|
|||||||
static int unload_module(void)
|
static int unload_module(void)
|
||||||
{
|
{
|
||||||
/* First, take us out of the channel loop */
|
/* First, take us out of the channel loop */
|
||||||
sched_context_destroy(sched);
|
if (sched)
|
||||||
|
sched_context_destroy(sched);
|
||||||
|
|
||||||
ast_cli_unregister_multiple(unistim_cli, ARRAY_LEN(unistim_cli));
|
ast_cli_unregister_multiple(unistim_cli, ARRAY_LEN(unistim_cli));
|
||||||
|
|
||||||
@@ -5646,8 +5650,10 @@ static int unload_module(void)
|
|||||||
monitor_thread = AST_PTHREADT_STOP;
|
monitor_thread = AST_PTHREADT_STOP;
|
||||||
ast_mutex_unlock(&monlock);
|
ast_mutex_unlock(&monlock);
|
||||||
|
|
||||||
free(buff);
|
if (buff)
|
||||||
close(unistimsock);
|
free(buff);
|
||||||
|
if (unistimsock > -1)
|
||||||
|
close(unistimsock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user