aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-09 15:32:43 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-09 15:32:43 +0000
commitb2057262593413cebcca79b8672cbad95637f3b7 (patch)
tree9ea9d6e9c458e3ae581faedc3270b633f734d1a2 /channels/chan_skinny.c
parentb0571185a36891704a09a8ec34182fdd719e93f8 (diff)
Only destroy the scheduler context if it was allocated. (issue #10124 reported by gzero)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74082 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 1035517ba..19e23185e 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -890,7 +890,7 @@ static char *skinny_cxmodes[] = {
#endif
/* driver scheduler */
-static struct sched_context *sched;
+static struct sched_context *sched = NULL;
static struct io_context *io;
/* Protect the monitoring thread, so only one process can kill or start it, and not
@@ -4800,7 +4800,8 @@ static int unload_module(void)
ast_cli_unregister_multiple(cli_skinny, sizeof(cli_skinny) / sizeof(struct ast_cli_entry));
close(skinnysock);
- sched_context_destroy(sched);
+ if (sched)
+ sched_context_destroy(sched);
return 0;
}