Browse Source

rtsp source: fix memory leak

This happened when the server was able to connect to the source,
but initialization failed before or during the PLAY request.
pull/764/head
aler9 4 years ago
parent
commit
ef255af093
  1. 2
      internal/core/rtsp_source.go

2
internal/core/rtsp_source.go

@ -168,6 +168,7 @@ func (s *rtspSource) runInner() bool { @@ -168,6 +168,7 @@ func (s *rtspSource) runInner() bool {
s.log(logger.Info, "ERR: %s", err)
return true
}
defer c.Close()
readErr := make(chan error)
go func() {
@ -231,7 +232,6 @@ func (s *rtspSource) runInner() bool { @@ -231,7 +232,6 @@ func (s *rtspSource) runInner() bool {
return true
case <-s.ctx.Done():
c.Close()
<-readErr
return false
}

Loading…
Cancel
Save