diff options
author | Martin Storsjö <martin@martin.st> | 2010-06-18 17:54:56 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-06-18 17:54:56 +0000 |
commit | d3f84dfc0e65201983e88c99b7544d5a60d0165e (patch) | |
tree | d27cb75b30a27d5d8710d9ca8b866ee779ca62b1 /libavformat | |
parent | e8ccf245276216e8d94aa1dc802053492254d22a (diff) | |
download | ffmpeg-d3f84dfc0e65201983e88c99b7544d5a60d0165e.tar.gz |
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.
Originally committed as revision 23643 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtsp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index e762f61e89..6507841cdb 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1594,12 +1594,14 @@ redirect: /* 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; } |