]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Sun, 25 Feb 2007 15:21:12 +0000 (15:21 +0000)
committerAutomerge Script <automerge@asterisk.org>
Sun, 25 Feb 2007 15:21:12 +0000 (15:21 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@56728 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channel.c

index 82758b3d47ca8dbb76d0d00129ba2b9e68590aa3..c218c437e30a857e647246f78345e9935403691b 100644 (file)
--- a/channel.c
+++ b/channel.c
@@ -747,7 +747,11 @@ static struct ast_channel *channel_find_locked(const struct ast_channel *prev,
                                if (c != prev)  /* not this one */
                                        continue;
                                /* found, prepare to return c->next */
-                               c = c->next;
+                               if ((c = c->next) == NULL) break;
+                               /* If prev was the last item on the channel list, then we just
+                                * want to return NULL, instead of trying to deref NULL in the
+                                * next section.
+                                */
                        }
                        if (name) { /* want match by name */
                                if ((!namelen && strcasecmp(c->name, name)) ||