Module: sip-router
Branch: richard.good/diameter_rx_media
Commit: 7ca25d38d0c3605d371b4a53f4fe808fce67c5ab
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7ca25d3…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Jun 20 10:31:30 2013 +0200
modules/ims_qos: fix memory free warning
- in rx_aar.c: free_saved_transaction_global_data() check lock exists before
deallocating
---
modules/ims_qos/rx_aar.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index ad8db69..b9e8e21 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -95,13 +95,13 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa,
long elaps
LM_DBG("Received AAR callback\n");
saved_transaction_t* data = (saved_transaction_t*) param;
-
+
LM_DBG("received AAA answer");
if (tmb.t_lookup_ident(&t, data->tindex, data->tlabel) < 0) {
LM_ERR("t_continue: transaction not found\n");
goto error;
- }else{
+ } else {
LM_DBG("t_continue: transaction found\n");
}
//we have T, lets restore our state (esp. for AVPs)
@@ -261,7 +261,7 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage
*aaa, long e
ul.unlock_udomain(domain_t, &local_data->contact);
goto error;
}
- memset(&ci, 0, sizeof(struct pcontact_info));
+ memset(&ci, 0, sizeof (struct pcontact_info));
ci.reg_state = PCONTACT_REG_PENDING_AAR;
ci.num_service_routes = 0;
ci.num_public_ids = 0;
@@ -696,9 +696,10 @@ void free_saved_transaction_global_data(saved_transaction_t* data) {
shm_free(data->ttag.s);
data->ttag.len = 0;
}
-
- lock_dealloc(data->lock);
- lock_destroy(data->lock);
+ if (data->lock) {
+ lock_dealloc(data->lock);
+ lock_destroy(data->lock);
+ }
shm_free(data);
}