From: Luigi Rizzo Date: Sun, 16 Apr 2006 15:22:13 +0000 (+0000) Subject: avoid returning in the middle of a switch() in ast_answer() X-Git-Tag: 1.4.0-beta1~1943 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba7c8dbd73b6c3f830307d4597ad3fc414f0b0e2;p=thirdparty%2Fasterisk.git avoid returning in the middle of a switch() in ast_answer() git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20512 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channel.c b/channel.c index 6a560cf00e..b760d100ea 100644 --- a/channel.c +++ b/channel.c @@ -1496,8 +1496,6 @@ int ast_answer(struct ast_channel *chan) ast_setstate(chan, AST_STATE_UP); if (chan->cdr) ast_cdr_answer(chan->cdr); - ast_channel_unlock(chan); - return res; break; case AST_STATE_UP: if (chan->cdr) @@ -1505,7 +1503,7 @@ int ast_answer(struct ast_channel *chan) break; } ast_channel_unlock(chan); - return 0; + return res; } void ast_deactivate_generator(struct ast_channel *chan)