# HG changeset patch # User mstorsjo # Date 1276883696 0 # Node ID 66b74fc6eeb9334e5060fa32f75ebcc39f5a8809 # Parent bd851edc58ace91e6eb57109acde12f7ca373daa 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. diff -r bd851edc58ac -r 66b74fc6eeb9 rtsp.c --- 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; }