Browse Source

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
tags/n0.8
Martin Storsjö 15 years ago
parent
commit
d3f84dfc0e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/rtsp.c

+ 2
- 0
libavformat/rtsp.c View File

@@ -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;
}


Loading…
Cancel
Save