[sr-dev] git:master:579853ec: Merge pull request #2896 from sergey-safarov/GH2892

GitHub noreply at github.com
Wed Nov 3 12:58:20 CET 2021


Module: kamailio
Branch: master
Commit: 579853ec6d6f2237641da7d80099f3ba996d6806
URL: https://github.com/kamailio/kamailio/commit/579853ec6d6f2237641da7d80099f3ba996d6806

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: GitHub <noreply at github.com>
Date: 2021-11-03T12:58:14+01:00

Merge pull request #2896 from sergey-safarov/GH2892

core: fixed route hash table cleanup

---

Modified: src/core/route.c

---

Diff:  https://github.com/kamailio/kamailio/commit/579853ec6d6f2237641da7d80099f3ba996d6806.diff
Patch: https://github.com/kamailio/kamailio/commit/579853ec6d6f2237641da7d80099f3ba996d6806.patch

---

diff --git a/src/core/route.c b/src/core/route.c
index ad2fa66e64..f520804312 100644
--- a/src/core/route.c
+++ b/src/core/route.c
@@ -91,8 +91,11 @@ inline static void destroy_rlist(struct route_list* rt)
 		rt->entries=0;
 	}
 	if (rt->names.table){
-		clist_foreach_safe(rt->names.table, e, tmp, next){
-			pkg_free(e);
+		int i;
+		for(i = 0; i < RT_HASH_SIZE; i++) {
+			clist_foreach_safe(&rt->names.table[i], e, tmp, next) {
+				pkg_free(e);
+			}
 		}
 		pkg_free(rt->names.table);
 		rt->names.table=0;




More information about the sr-dev mailing list