Selaa lähdekoodia

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

nsq: fix segfault on module destroy
Emmanuel Schmidbauer 9 vuotta sitten
vanhempi
commit
64bab0c385
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  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;
 }