From 94cd7026ef727edf759628e78ec49dc2fabdb766 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 9 Jul 2007 15:32:43 +0000 Subject: [PATCH] Only destroy the scheduler context if it was allocated. (issue #10124 reported by gzero) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74082 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_skinny.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 1035517ba1..19e23185ec 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; }