diff --git a/sctptransport_test.go b/sctptransport_test.go index d8eb6155d7f..b18fc2281cb 100644 --- a/sctptransport_test.go +++ b/sctptransport_test.go @@ -59,6 +59,8 @@ func TestSCTPTransportOnClose(t *testing.T) { offerPC, answerPC, err := newPair() require.NoError(t, err) + defer closePairNow(t, offerPC, answerPC) + answerPC.OnDataChannel(func(dc *DataChannel) { dc.OnMessage(func(_ DataChannelMessage) { if err1 := dc.Send([]byte("hello")); err1 != nil {