Skip to content
Snippets Groups Projects
Commit 2ce386d1 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

Remove bad usage of goto in ChanSpy next_channel().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 2d92c50c
No related branches found
No related tags found
No related merge requests found
...@@ -742,23 +742,18 @@ static struct ast_autochan *next_channel(struct ast_channel_iterator *iter, ...@@ -742,23 +742,18 @@ static struct ast_autochan *next_channel(struct ast_channel_iterator *iter,
return NULL; return NULL;
} }
redo: for (; (next = ast_channel_iterator_next(iter)); ast_channel_unref(next)) {
if (!(next = ast_channel_iterator_next(iter))) { if (!strncmp(ast_channel_name(next), "DAHDI/pseudo", pseudo_len)
return NULL; || next == chan) {
} continue;
}
if (!strncmp(ast_channel_name(next), "DAHDI/pseudo", pseudo_len)) { autochan_store = ast_autochan_setup(next);
ast_channel_unref(next); ast_channel_unref(next);
goto redo;
} else if (next == chan) {
ast_channel_unref(next);
goto redo;
}
autochan_store = ast_autochan_setup(next); return autochan_store;
ast_channel_unref(next); }
return NULL;
return autochan_store;
} }
static int common_exec(struct ast_channel *chan, struct ast_flags *flags, static int common_exec(struct ast_channel *chan, struct ast_flags *flags,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment