From 778cbbd23eea54628b43affb5e0a2387f4d46a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Fuente=20P=C3=A9rez?= Date: Wed, 15 Jan 2025 10:51:18 +0100 Subject: [PATCH] Fix possible deadlock dut to missing mutex unlock in datachannel.go Caused by a regression introduced in commit https://github.com/pion/webrtc/commit/835ac3b08ef5dfd0f6c0b047cdeea635258a21e3#diff-b8da7f3e746d55a2fe2a4295ae5fe5cf76b9512d7665201285143e25ab3bd3b9L423 --- datachannel.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datachannel.go b/datachannel.go index 52de821b7e5..ea50a031feb 100644 --- a/datachannel.go +++ b/datachannel.go @@ -464,10 +464,12 @@ func (d *DataChannel) DetachWithDeadline() (datachannel.ReadWriteCloserDeadliner d.mu.Lock() if !d.api.settingEngine.detach.DataChannels { + d.mu.Unlock() return nil, errDetachNotEnabled } if d.dataChannel == nil { + d.mu.Unlock() return nil, errDetachBeforeOpened }