From f846e25d68c214454686c64ad7d66056376e7b13 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 7 Dec 2016 16:46:08 +0100 Subject: [PATCH] make sure terminated transaction no longer reference op --- coreapi/bellesip_sal/sal_impl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index e01faa9a9..b23f1fc51 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -397,7 +397,7 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even belle_sip_header_contact_t* remote_contact = belle_sip_message_get_header_by_type(response, belle_sip_header_contact_t); if (op->state == SalOpStateTerminated) { - belle_sip_message("Op is terminated, nothing to do with this [%i]",response_code); + belle_sip_message("Op [%p] is terminated, nothing to do with this [%i]", op, response_code); return; } /*do it all the time, since we can receive provisional responses from a different instance than the final one*/ @@ -482,7 +482,10 @@ static void process_transaction_terminated(void *user_ctx, const belle_sip_trans } else { ms_message("Unhandled transaction terminated [%p]",trans); } - if (op) sal_op_unref(op); /*because every transaction ref op*/ + if (op) { + sal_op_unref(op); /*because every transaction ref op*/ + belle_sip_transaction_set_application_data(trans,NULL); /*no longuer reference something we do not ref to avoid futur access of a released op*/ + } }