]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Do not dereference the channel if AST_PBX_KEEPALIVE has been returned.
authorRussell Bryant <russell@russellbryant.com>
Tue, 16 Dec 2008 21:10:44 +0000 (21:10 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 16 Dec 2008 21:10:44 +0000 (21:10 +0000)
This is a bug I noticed while looking at the code for app_macro.  This return code
means that another thread has assumed ownership of the channel and it can no longer
be touched.  (I hate this return code with a passion, by the way.)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164876 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_macro.c

index 7906ed4b2a107bf2c5d840a128163d9be3a53ae7..46ae71ccea57c630b51fbd5e62267b6e2f860c40 100644 (file)
@@ -322,8 +322,8 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
                                        ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
                                else if (option_verbose > 1)
                                        ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
+                               dead = 1;
                                goto out;
-                               break;
                        default:
                                if (option_debug)
                                        ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);