aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 17:02:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-23 17:02:50 +0000
commit1d054ae4f06d8254188fc3f1e574931668d3c2f0 (patch)
tree0736f5783827766bd44348375015ee24ef82c2bc /channels/chan_iax2.c
parent49117809e47318400e72667ab884b8f86727cc76 (diff)
Fix some code where it was possible for a reference to a peer to not get
released when it should. Thank you to Marta Carbone for pointing this out! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80499 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c8
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,