[FFmpeg-devel] [PATCH 2/2] avformat/sctp: close socket on errors

Michael Niedermayer michael at niedermayer.cc
Mon May 23 03:35:29 EEST 2022


This is untested as i have no testcase

Fixes: CID1302709

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/sctp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/sctp.c b/libavformat/sctp.c
index b8e23653d2..9d9e90097e 100644
--- a/libavformat/sctp.c
+++ b/libavformat/sctp.c
@@ -282,6 +282,8 @@ fail:
         goto restart;
     }
 fail1:
+    if (fd >= 0)
+        closesocket(fd);
     ret = AVERROR(EIO);
     freeaddrinfo(ai);
     return ret;
-- 
2.17.1



More information about the ffmpeg-devel mailing list