[sr-dev] git:master:8d22d827: core: fixed route hash table cleanup

Sergey Safarov s.safarov at gmail.com
Wed Nov 3 12:58:20 CET 2021


Module: kamailio
Branch: master
Commit: 8d22d827d93f7fd5a9a29ee83d30c3b297c02241
URL: https://github.com/kamailio/kamailio/commit/8d22d827d93f7fd5a9a29ee83d30c3b297c02241

Author: Sergey Safarov <s.safarov at gmail.com>
Committer: Sergey Safarov <s.safarov at gmail.com>
Date: 2021-10-23T19:44:57+03:00

core: fixed route hash table cleanup

---

Modified: src/core/route.c

---

Diff:  https://github.com/kamailio/kamailio/commit/8d22d827d93f7fd5a9a29ee83d30c3b297c02241.diff
Patch: https://github.com/kamailio/kamailio/commit/8d22d827d93f7fd5a9a29ee83d30c3b297c02241.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