mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-02 20:53:02 +00:00
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.
This commit is contained in:
parent
6f5bc158cd
commit
ef255af093
@ -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 {
|
||||
return true
|
||||
|
||||
case <-s.ctx.Done():
|
||||
c.Close()
|
||||
<-readErr
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user