changeset 6143:66b74fc6eeb9 libavformat

RTSP: Clean up rtsp_hd on failure Since rtsp_hd isn't assigned to rt->rtsp_hd until after the setup phase, the initialized URLContext could be leaked on failures.
author mstorsjo
date Fri, 18 Jun 2010 17:54:56 +0000
parents bd851edc58ac
children f2c92e715300
files rtsp.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rtsp.c	Fri Jun 18 12:02:51 2010 +0000
+++ b/rtsp.c	Fri Jun 18 17:54:56 2010 +0000
@@ -1594,12 +1594,14 @@
 
         /* complete the connection */
         if (url_read(rtsp_hd, NULL, 0)) {
+            url_close(rtsp_hd);
             err = AVERROR(EIO);
             goto fail;
         }
 
         /* POST requests */
         if (url_open(&rtsp_hd_out, httpname, URL_WRONLY) < 0 ) {
+            url_close(rtsp_hd);
             err = AVERROR(EIO);
             goto fail;
         }