[sr-dev] git:master:5a6a6799: tm: prper timer cleanup of responses for rpc tm.t_uac_wait_block

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 27 14:11:32 CET 2021


Module: kamailio
Branch: master
Commit: 5a6a679985fecfc168b9b26f0be3c0e64e641e64
URL: https://github.com/kamailio/kamailio/commit/5a6a679985fecfc168b9b26f0be3c0e64e641e64

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-01-27T14:10:34+01:00

tm: prper timer cleanup of responses for rpc tm.t_uac_wait_block

---

Modified: src/modules/tm/rpc_uac.c

---

Diff:  https://github.com/kamailio/kamailio/commit/5a6a679985fecfc168b9b26f0be3c0e64e641e64.diff
Patch: https://github.com/kamailio/kamailio/commit/5a6a679985fecfc168b9b26f0be3c0e64e641e64.patch

---

diff --git a/src/modules/tm/rpc_uac.c b/src/modules/tm/rpc_uac.c
index 94782dde00..4ca2274c9d 100644
--- a/src/modules/tm/rpc_uac.c
+++ b/src/modules/tm/rpc_uac.c
@@ -204,14 +204,16 @@ void tm_rpc_response_list_clean(unsigned int ticks, void *param)
 	ri1 = _tm_rpc_response_list->rlist;
 	while(ri1!=NULL) {
 		if(ri1->rtime < tnow - TM_RPC_RESPONSE_LIFETIME) {
+			LM_DBG("freeing item [%.*s]\n", ri1->ruid.len, ri1->ruid.s);
 			if(ri0 == NULL) {
 				_tm_rpc_response_list->rlist = ri1->next;
+				shm_free(ri1);
+				ri1 = _tm_rpc_response_list->rlist;
 			} else {
 				ri0->next = ri1->next;
+				shm_free(ri1);
+				ri1 = ri0->next;
 			}
-			LM_DBG("freeing item [%.*s]\n", ri1->ruid.len, ri1->ruid.s);
-			shm_free(ri1);
-			ri1 = ri0->next;
 		} else {
 			ri0 = ri1;
 			ri1 = ri1->next;




More information about the sr-dev mailing list