From: Luigi Rizzo Date: Fri, 21 Apr 2006 12:12:42 +0000 (+0000) Subject: minor cleanup X-Git-Tag: 1.4.0-beta1~1841 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97d1c9a3c6386eedf9eff31a629cbf7d9d499346;p=thirdparty%2Fasterisk.git minor cleanup git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21878 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/pbx.c b/pbx.c index a20dd5a4a2..004900e82f 100644 --- a/pbx.c +++ b/pbx.c @@ -4157,9 +4157,10 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex /* In order to do it when the channel doesn't really exist within the PBX, we have to make a new channel, masquerade, and start the PBX at the new location */ - struct ast_channel *tmpchan; - tmpchan = ast_channel_alloc(0); - if (tmpchan) { + struct ast_channel *tmpchan = ast_channel_alloc(0); + if (!tmpchan) + res = -1; + else { ast_string_field_build(tmpchan, name, "AsyncGoto/%s", chan->name); ast_setstate(tmpchan, chan->_state); /* Make formats okay */ @@ -4167,9 +4168,7 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex tmpchan->writeformat = chan->writeformat; /* Setup proper location */ ast_explicit_goto(tmpchan, - S_OR(context, chan->context), - S_OR(exten, chan->exten), - priority); + S_OR(context, chan->context), S_OR(exten, chan->exten), priority); /* Masquerade into temp channel */ ast_channel_masquerade(tmpchan, chan); @@ -4184,8 +4183,6 @@ int ast_async_goto(struct ast_channel *chan, const char *context, const char *ex ast_hangup(tmpchan); res = -1; } - } else { - res = -1; } } ast_mutex_unlock(&chan->lock); @@ -4288,7 +4285,7 @@ int ast_add_extension2(struct ast_context *con, if (callerid) length += strlen(callerid) + 1; else - length ++; + length ++; /* just the '\0' */ /* Be optimistic: Build the extension structure first */ if (datad == NULL)