From 2f8244d39b12297f86fddd314fb302450ba067a8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 6 Jun 2014 10:07:25 +0200 Subject: [PATCH] memory leak hunting --- coreapi/bellesip_sal/sal_impl.c | 5 ++--- coreapi/bellesip_sal/sal_op_call.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index 6896496f7..92017616d 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -342,7 +342,6 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even break; case 401: case 407: - /*belle_sip_transaction_set_application_data(BELLE_SIP_TRANSACTION(client_transaction),NULL);*//*remove op from trans*/ if (op->state == SalOpStateTerminating && strcmp("BYE",belle_sip_request_get_method(request))!=0) { /*only bye are completed*/ belle_sip_message("Op is in state terminating, nothing else to do "); @@ -396,7 +395,7 @@ static void process_transaction_terminated(void *user_ctx, const belle_sip_trans if(client_transaction) trans=BELLE_SIP_TRANSACTION(client_transaction); else - trans=BELLE_SIP_TRANSACTION(server_transaction); + trans=BELLE_SIP_TRANSACTION(server_transaction); op = (SalOp*)belle_sip_transaction_get_application_data(trans); if (op && op->callbacks && op->callbacks->process_transaction_terminated) { @@ -404,7 +403,7 @@ static void process_transaction_terminated(void *user_ctx, const belle_sip_trans } else { ms_message("Unhandled transaction terminated [%p]",trans); } - if (op && client_transaction) sal_op_unref(op); /*because every client transaction ref op*/ + if (op) sal_op_unref(op); /*because every transaction ref op*/ } diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index f8d35e15c..4d61feca9 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -427,8 +427,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t if (strcmp("ACK",method)!=0){ /*ACK does'nt create srv transaction*/ server_transaction = belle_sip_provider_create_server_transaction(op->base.root->prov,belle_sip_request_event_get_request(event)); belle_sip_object_ref(server_transaction); - belle_sip_transaction_set_application_data(BELLE_SIP_TRANSACTION(server_transaction),op); - sal_op_ref(op); + belle_sip_transaction_set_application_data(BELLE_SIP_TRANSACTION(server_transaction),sal_op_ref(op)); } if (strcmp("INVITE",method)==0) {