From: Automerge Script Date: Sun, 25 Feb 2007 15:21:12 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.16-netsec~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c31b4a6a2e7557bc8f2510b67fa5ab3e37d6b0d5;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@56728 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channel.c b/channel.c index 82758b3d47..c218c437e3 100644 --- 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)) ||