[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-commits
Subject: [asterisk-commits] =?utf-8?q?res_pjsip_outbound_publish=3A_Ensure?= =?utf-8?q?_publish_is_valid_when
From: SVN commits to the Asterisk project <asterisk-commits () lists ! digium ! com>
Date: 2016-05-25 13:38:23
Message-ID: mailman.1670.1464183505.1232.asterisk-commits () lists ! digium ! com
[Download RAW message or body]
Anonymous Coward #1000019 has submitted this change and it was merged.
Change subject: res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying.
......................................................................
res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying.
Recent changes to res_pjsip_outbound_publish have introduced a
race condition at shutdown where an outbound publish may be shutdown
twice. In this case the first succeeds as a result of the unpublish.
In the second invocation since it's been unpublished a task is
queued to just destroy the client. This task holds no ref to the
publish and as a result the publish may be destroyed before the
task is run, causing a crash.
This explicit destruction task now holds a reference to the publish
to ensure it remains valid.
ASTERISK-26053 #close
Change-Id: I10789b98add3e50292ee3b33a55a1d9061cec94b
---
M res/res_pjsip_outbound_publish.c
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
George Joseph: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 1c3b0c6..53e15a0 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -1125,6 +1125,8 @@
ao2_ref(publisher, -1);
}
+ ao2_ref(publisher, -1);
+
return 0;
}
@@ -1140,7 +1142,9 @@
/* If the publisher was never started, there's nothing to unpublish, so just
* destroy the publication and remove its reference to the publisher.
*/
- ast_sip_push_task(NULL, explicit_publish_destroy, publisher);
+ if (ast_sip_push_task(NULL, explicit_publish_destroy, ao2_bump(publisher))) {
+ ao2_ref(publisher, -1);
+ }
return 0;
}
--
To view, visit https://gerrit.asterisk.org/2898
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I10789b98add3e50292ee3b33a55a1d9061cec94b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp@digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph@digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp@digium.com>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-commits mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic