diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_iax2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 546f14da1..214432400 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -5432,10 +5432,12 @@ static int authenticate_reply(struct chan_iax2_pvt *p, struct sockaddr_in *sin, /* No specified host, or this is our host */ ) { res = authenticate(p->challenge, peer->secret, peer->outkey, authmethods, &ied, sin, &p->ecx, &p->dcx); - peer_unref(peer); - if (!res) - break; + if (!res) { + peer_unref(peer); + break; + } } + peer_unref(peer); } if (!peer) { /* We checked our list and didn't find one. It's unlikely, but possible, |