summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-04-07 13:30:25 +0000
committerKinsey Moore <kmoore@digium.com>2014-04-07 13:30:25 +0000
commit5d9a1281eebe29bd6b0a370514be6a29dac5af28 (patch)
tree9bcc6c9fb451aa71e05c8c8b22c46837556ecf12 /res
parentea290b2c3ea5df6a3f7add568536909e7c68551f (diff)
PJSIP: Fix crash introduced in r411671
The test event introduced in revision 411671 uses a dangling pointer to access information about pubsub state changes. This moves the event to within the lifetime of the pointer. ........ Merged revisions 411790 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_pubsub.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 0b53af6c0..468346024 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -466,17 +466,16 @@ pjsip_dialog *ast_sip_subscription_get_dlg(struct ast_sip_subscription *sub)
int ast_sip_subscription_send_request(struct ast_sip_subscription *sub, pjsip_tx_data *tdata)
{
struct ast_sip_endpoint *endpoint = ast_sip_subscription_get_endpoint(sub);
- int res = pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
- tdata) == PJ_SUCCESS ? 0 : -1;
-
+
ast_test_suite_event_notify("SUBSCRIPTION_STATE_SET",
"StateText: %s\r\n"
"Endpoint: %s\r\n",
pjsip_evsub_get_state_name(ast_sip_subscription_get_evsub(sub)),
ast_sorcery_object_get_id(endpoint));
-
ao2_cleanup(endpoint);
- return res;
+
+ return pjsip_evsub_send_request(ast_sip_subscription_get_evsub(sub),
+ tdata) == PJ_SUCCESS ? 0 : -1;
}
static void subscription_datastore_destroy(void *obj)