mmsh: Properly clean up if the second ffurl_alloc failed
authorMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 09:48:03 +0000 (11:48 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 1 Dec 2011 11:47:26 +0000 (13:47 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/mmsh.c

index 8a6de32..3761016 100644 (file)
@@ -262,9 +262,9 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
     // close the socket and then reopen it for sending the second play request.
     ffurl_close(mms->mms_hd);
     memset(headers, 0, sizeof(headers));
-    if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
-                    &h->interrupt_callback) < 0) {
-        return AVERROR(EIO);
+    if ((err = ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
+                           &h->interrupt_callback)) < 0) {
+        goto fail;
     }
     stream_selection = av_mallocz(mms->stream_num * 19 + 1);
     if (!stream_selection)