diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-31 19:11:26 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-03-31 19:11:26 +0000 |
commit | 862c5ca2c205d84093f91f36600a9dca9f31829f (patch) | |
tree | 70b8fac6697229427b3772d126446a24ad7eb588 | |
parent | c95a7ce918619193552e7d45a24271d6385d9672 (diff) |
move a NULL check to before the first time the pointer is dereferenced (issue #6832)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@16771 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_iax2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index c497f30d6..bff2100d7 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1486,6 +1486,8 @@ static int send_packet(struct iax_frame *f) int res; char iabuf[INET_ADDRSTRLEN]; /* Called with iaxsl held */ + if (!iaxs[f->callno]) + return -1; if (option_debug > 2 && iaxdebug) ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, f->callno, iaxs[f->callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr), ntohs(iaxs[f->callno]->addr.sin_port)); /* Don't send if there was an error, but return error instead */ @@ -1493,8 +1495,6 @@ static int send_packet(struct iax_frame *f) ast_log(LOG_WARNING, "Call number = %d\n", f->callno); return -1; } - if (!iaxs[f->callno]) - return -1; if (iaxs[f->callno]->error) return -1; if (f->transfer) { |