Module: kamailio
Branch: master
Commit: 325a45e846faae3e5dfa333727d5fab294e44dac
URL:
https://github.com/kamailio/kamailio/commit/325a45e846faae3e5dfa333727d5fab…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-03-04T22:29:04+01:00
tm: safe list iteration in tm_clean_lifetime()
---
Modified: src/modules/tm/h_table.c
---
Diff:
https://github.com/kamailio/kamailio/commit/325a45e846faae3e5dfa333727d5fab…
Patch:
https://github.com/kamailio/kamailio/commit/325a45e846faae3e5dfa333727d5fab…
---
diff --git a/src/modules/tm/h_table.c b/src/modules/tm/h_table.c
index 4d67b75a3a..a8545b220e 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]");