Browse code

mmsh: Properly clean up if the second ffurl_alloc failed

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2011/12/01 18:48:03
Showing 1 changed files
... ...
@@ -262,9 +262,9 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
262 262
     // close the socket and then reopen it for sending the second play request.
263 263
     ffurl_close(mms->mms_hd);
264 264
     memset(headers, 0, sizeof(headers));
265
-    if (ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
266
-                    &h->interrupt_callback) < 0) {
267
-        return AVERROR(EIO);
265
+    if ((err = ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
266
+                           &h->interrupt_callback)) < 0) {
267
+        goto fail;
268 268
     }
269 269
     stream_selection = av_mallocz(mms->stream_num * 19 + 1);
270 270
     if (!stream_selection)