Module: kamailio
Branch: master
Commit: 64bab0c38596c9dea13a22a5d2a89c5e24238fe2
URL:
https://github.com/kamailio/kamailio/commit/64bab0c38596c9dea13a22a5d2a89c5…
Author: Emmanuel Schmidbauer <emmanuel(a)getweave.com>
Committer: Emmanuel Schmidbauer <emmanuel(a)getweave.com>
Date: 2016-05-11T11:06:26-04:00
Merge pull request #613 from kamailio/NSQ/bugfix-segfault-free-topic-channel
nsq: fix segfault on module destroy
---
Modified: modules/nsq/nsq_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/64bab0c38596c9dea13a22a5d2a89c5…
Patch:
https://github.com/kamailio/kamailio/commit/64bab0c38596c9dea13a22a5d2a89c5…
---
diff --git a/modules/nsq/nsq_mod.c b/modules/nsq/nsq_mod.c
index 54d50b5..fde9094 100644
--- a/modules/nsq/nsq_mod.c
+++ b/modules/nsq/nsq_mod.c
@@ -68,14 +68,14 @@ static param_export_t params[]=
static void free_tc_list(nsq_topic_channel_t *tcl)
{
- nsq_topic_channel_t *tc, *prev_tc;
+ nsq_topic_channel_t *tc, *tc0;
tc = tcl;
while (tc) {
- prev_tc = tc;
- tc = tc->next;
+ tc0 = tc->next;
free(tc->topic);
free(tc->channel);
- pkg_free(prev_tc);
+ pkg_free(tc);
+ tc = tc0;
}
tcl = NULL;
}