2
0
Эх сурвалжийг харах

nsq: fix segfault on module destroy

Emmanuel Schmidbauer 9 жил өмнө
parent
commit
e7eb7a24d0
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  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)
 {
-	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;
 }