Ver código fonte

Merge pull request #613 from kamailio/NSQ/bugfix-segfault-free-topic-channel

nsq: fix segfault on module destroy
Emmanuel Schmidbauer 9 anos atrás
pai
commit
64bab0c385
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      modules/nsq/nsq_mod.c

+ 4 - 4
modules/nsq/nsq_mod.c

@@ -68,14 +68,14 @@ static param_export_t params[]=
 
 
 static void free_tc_list(nsq_topic_channel_t *tcl)
 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;
 	tc = tcl;
 	while (tc) {
 	while (tc) {
-		prev_tc = tc;
-		tc = tc->next;
+		tc0 = tc->next;
 		free(tc->topic);
 		free(tc->topic);
 		free(tc->channel);
 		free(tc->channel);
-		pkg_free(prev_tc);
+		pkg_free(tc);
+		tc = tc0;
 	}
 	}
 	tcl = NULL;
 	tcl = NULL;
 }
 }