From be09062a6ac6c57a12947c808724ba358ec19151 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 5 Jul 2007 23:59:22 +0000 Subject: [PATCH] Fix a crash in chan_sip. Don't try to stop the monitor thread if it was never started. (closes issue #10124, reported by gzero, fixed by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73598 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 789bb1bc00..2585d5368e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17642,7 +17642,7 @@ static int unload_module(void) ast_mutex_unlock(&iflock); ast_mutex_lock(&monlock); - if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP)) { + if (monitor_thread && (monitor_thread != AST_PTHREADT_STOP) && (monitor_thread != AST_PTHREADT_NULL)) { pthread_cancel(monitor_thread); pthread_kill(monitor_thread, SIGURG); pthread_join(monitor_thread, NULL);