From e7eb7a24d0ceaf77803ff2d9c798a9b3247b89ff Mon Sep 17 00:00:00 2001 From: Emmanuel Schmidbauer Date: Wed, 11 May 2016 10:34:25 -0400 Subject: [PATCH] nsq: fix segfault on module destroy --- modules/nsq/nsq_mod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/nsq/nsq_mod.c b/modules/nsq/nsq_mod.c index 54d50b56c83..fde9094ff0e 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; }