Module: kamailio
Branch: master
Commit: 6711306d48be16fcf1dff860f72d0db14cac02fc
URL:
https://github.com/kamailio/kamailio/commit/6711306d48be16fcf1dff860f72d0db…
Author: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Committer: Stefan Mititelu <stefan.mititelu(a)1and1.ro>
Date: 2016-01-27T10:41:06+02:00
rtpengine: Fix coredump on kamailio shutdown
Fix release_lock leading to coredump, when kamailio shutdown.
---
Modified: modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6711306d48be16fcf1dff860f72d0db…
Patch:
https://github.com/kamailio/kamailio/commit/6711306d48be16fcf1dff860f72d0db…
---
diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 1782258..30db81a 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -1951,16 +1951,16 @@ static void mod_destroy(void)
lock_get(rtpp_set_list->rset_head_lock);
for(crt_list = rtpp_set_list->rset_first; crt_list != NULL; ){
+ last_list = crt_list;
if (!crt_list->rset_lock) {
- last_list = crt_list;
crt_list = last_list->rset_next;
shm_free(last_list);
last_list = NULL;
continue;
}
- lock_get(crt_list->rset_lock);
+ lock_get(last_list->rset_lock);
for(crt_rtpp = crt_list->rn_first; crt_rtpp != NULL; ){
if(crt_rtpp->rn_url.s)
@@ -1970,9 +1970,8 @@ static void mod_destroy(void)
crt_rtpp = last_rtpp->rn_next;
shm_free(last_rtpp);
}
- last_list = crt_list;
crt_list = last_list->rset_next;
- lock_release(crt_list->rset_lock);
+ lock_release(last_list->rset_lock);
lock_destroy(last_list->rset_lock);
lock_dealloc((void*)last_list->rset_lock);