aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-07 20:09:00 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-07 20:09:00 +0000
commitf28601a4b00a7b39fd8d3826b02c98e4b868e476 (patch)
tree97ae6c9ddb913386cfbb173b55bc8ce7381e2448 /channels
parent8ac1bfd0ebbdb7434564344ed6834a0072fa61be (diff)
Fixes some ref count issues introduced by r274539
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@274686 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4e040ae2e..5d8b7b4e9 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5259,7 +5259,8 @@ static int update_call_counter(struct sip_pvt *fup, int event)
ast_copy_string(name, fup->username, sizeof(name));
/* Check the list of devices */
- if ((p = fup->relatedpeer)) {
+ if (fup->relatedpeer) {
+ p = ref_peer(fup->relatedpeer, "ref related peer for update_call_counter");
inuse = &p->inUse;
call_limit = &p->call_limit;
inringing = &p->inRinging;
@@ -20720,8 +20721,10 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int
}
/* Successful authentication and peer matching so record the peer related to this pvt (for easy access to peer settings) */
+ if (p->relatedpeer) {
+ p->relatedpeer = unref_peer(p->relatedpeer,"unsetting the relatedpeer field in the dialog, before it is set to something else.");
+ }
p->relatedpeer = ref_peer(authpeer, "setting dialog's relatedpeer pointer");
-
/* If T38 is needed but not present, then make it magically appear */
if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl) {
if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
@@ -21166,6 +21169,9 @@ request_invite_cleanup:
ast_channel_unlock(p->refer->refer_call->owner);
}
}
+ if (authpeer) {
+ authpeer = unref_peer(authpeer, "unref_peer, from handle_request_invite authpeer");
+ }
return res;
}