vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Apr 26 
12:03:09 2020 +0300| [1ec49fcf11570f1eb043089997d387cc44daa7ba] | committer: 
Rémi Denis-Courmont

rtp: fix descriptor leak on error

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ec49fcf11570f1eb043089997d387cc44daa7ba
---

 modules/access/rtp/rtp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 25c0e2725b..db2d28ecdc 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -401,8 +401,11 @@ static int OpenURL(vlc_object_t *obj)
     }
 
     free (tmp);
-    if (fd == -1)
+    if (fd == -1) {
+        if (rtcp_fd != -1)
+            net_Close(rtcp_fd);
         return VLC_EGENERIC;
+    }
     net_SetCSCov (fd, -1, 12);
 
     /* Initializes demux */

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to