don't unlock a channel we didn't lock
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 1 Sep 2005 20:15:58 +0000 (20:15 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 1 Sep 2005 20:15:58 +0000 (20:15 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6486 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 511218e..9db31fa 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -4881,7 +4881,8 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
                                        ast_verbose(VERBOSE_PREFIX_4 "Channel %s was answered.\n", chan->name);
 
                                if (sync > 1) {
-                                       ast_mutex_unlock(&chan->lock);
+                                       if (channel)
+                                               ast_mutex_unlock(&chan->lock);
                                        if (ast_pbx_run(chan)) {
                                                ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
                                                ast_hangup(chan);