From 85bf7d9a97cfd476cc6a38792002fbf75c4a1716 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 23 Jun 2014 18:52:53 +0200 Subject: [PATCH] fix possible use of freed object --- coreapi/bellesip_sal/sal_op_registration.c | 4 +++- mediastreamer2 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_registration.c b/coreapi/bellesip_sal/sal_op_registration.c index 0f011d308..b51435a4f 100644 --- a/coreapi/bellesip_sal/sal_op_registration.c +++ b/coreapi/bellesip_sal/sal_op_registration.c @@ -56,13 +56,15 @@ static void register_refresher_listener (belle_sip_refresher_t* refresher chooses not to re-register, the UA SHOULD discard any stored service route for that address-of-record. */ sal_op_set_service_route(op,NULL); + sal_op_ref(op); /*take a ref while invoking the callback to make sure the operations done after are valid*/ op->base.root->callbacks.register_failure(op); - if (op->auth_info) { + if (op->state!=SalOpStateTerminated && op->auth_info) { /*add pending auth*/ sal_add_pending_auth(op->base.root,op); if (status_code==403 || status_code==401 || status_code==407 ) op->base.root->callbacks.auth_failure(op,op->auth_info); } + sal_op_unref(op); } } diff --git a/mediastreamer2 b/mediastreamer2 index fdf4db8e0..be7b962af 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit fdf4db8e0c2a5aa9b7c054f22df6fdb31a21fa46 +Subproject commit be7b962af74afcfbabe3d99bd0cea447c8fb8fae