Browse Source

fix: failure to create whep client leaks

when read fails, client is not closed
pull/3124/head
Jonathan Martin 2 years ago
parent
commit
d344367b24
  1. 1
      internal/staticsources/webrtc/source.go

1
internal/staticsources/webrtc/source.go

@ -53,6 +53,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error { @@ -53,6 +53,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
tracks, err := client.Read(params.Context)
if err != nil {
client.Close()
return err
}
defer client.Close() //nolint:errcheck

Loading…
Cancel
Save