Просмотр исходного кода

Fixed: potential nil pointer access

Rod Hynes 11 лет назад
Родитель
Сommit
6618958fde
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      psiphon/runTunnel.go

+ 3 - 1
psiphon/runTunnel.go

@@ -110,7 +110,9 @@ func establishTunnel(config *Config) (tunnel *Tunnel, err error) {
 			err = errors.New("timeout establishing tunnel")
 		}
 	}
-	cycler.Close()
+	if cycler != nil {
+		cycler.Close()
+	}
 	close(candidateServerEntries)
 	close(broadcastStopWorkers)
 	// Clean up is now asynchronous since Windows doesn't support interruptible connections