nsq: fix segfault on module destroy 613/head
authorEmmanuel Schmidbauer <emmanuel@getweave.com>
Wed, 11 May 2016 14:34:25 +0000 (10:34 -0400)
committerEmmanuel Schmidbauer <emmanuel@getweave.com>
Wed, 11 May 2016 14:34:25 +0000 (10:34 -0400)
modules/nsq/nsq_mod.c

index 54d50b5..fde9094 100644 (file)
@@ -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;
 }