Browse Source

Fix: double mutex unlock

Rod Hynes 8 years ago
parent
commit
f894d80ec1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      psiphon/packetTunnelTransport.go

+ 1 - 1
psiphon/packetTunnelTransport.go

@@ -205,13 +205,13 @@ func (p *PacketTunnelTransport) setChannel(
 	channelConn net.Conn, channelTunnel *Tunnel) {
 
 	p.channelMutex.Lock()
-	defer p.channelMutex.Unlock()
 
 	// Concurrency note: this check is within the mutex to ensure that a
 	// UseNewTunnel call concurrent with a Close call doesn't leave a channel
 	// set.
 	select {
 	case <-p.runContext.Done():
+		p.channelMutex.Unlock()
 		return
 	default:
 	}