Module: kamailio
Branch: 5.3
Commit: 575ab954538cbd7fdd6ac763fa4fd1c9e5b7ab4b
URL:
https://github.com/kamailio/kamailio/commit/575ab954538cbd7fdd6ac763fa4fd1c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-09T09:17:42+01:00
tm: safe list iteration in tm_clean_lifetime()
(cherry picked from commit 325a45e846faae3e5dfa333727d5fab294e44dac)
---
Modified: src/modules/tm/h_table.c
---
Diff:
https://github.com/kamailio/kamailio/commit/575ab954538cbd7fdd6ac763fa4fd1c…
Patch:
https://github.com/kamailio/kamailio/commit/575ab954538cbd7fdd6ac763fa4fd1c…
---
diff --git a/src/modules/tm/h_table.c b/src/modules/tm/h_table.c
index d0ec6c8452..cf5201caec 100644
--- a/src/modules/tm/h_table.c
+++ b/src/modules/tm/h_table.c
@@ -596,6 +596,7 @@ void tm_clean_lifetime(void)
{
int r;
tm_cell_t *tcell;
+ tm_cell_t *bcell;
ticks_t texp;
texp = get_ticks_raw() - S_TO_TICKS(TM_LIFETIME_LIMIT);
@@ -612,7 +613,7 @@ void tm_clean_lifetime(void)
continue;
}
- clist_foreach(&_tm_table->entries[r], tcell, next_c)
+ clist_foreach_safe(&_tm_table->entries[r], tcell, bcell, next_c)
{
if(TICKS_GT(texp, tcell->end_of_life)) {
tm_log_transaction(tcell, L_WARN, "[hard cleanup]");