summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-06-18 17:54:56 +0000
committerMartin Storsjö <martin@martin.st>2010-06-18 17:54:56 +0000
commitd3f84dfc0e65201983e88c99b7544d5a60d0165e (patch)
treed27cb75b30a27d5d8710d9ca8b866ee779ca62b1 /libavformat/rtsp.c
parente8ccf245276216e8d94aa1dc802053492254d22a (diff)
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/rtsp.c')
-rw-r--r--libavformat/rtsp.c2
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;
}