[5/7] mmsh: Properly clean up if the second ffurl_alloc failed

Message ID 1322734056-84812-5-git-send-email-martin@martin.st
State Committed
Commit 9c6777bd9367e8680bb7ada9852f5760dc8a8594
Headers show

Commit Message

Martin Storsjö Dec. 1, 2011, 10:07 a.m.
---
 libavformat/mmsh.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Luca Barbato Dec. 1, 2011, 10:52 a.m. | #1
On 01/12/11 11:07, Martin Storsjö wrote:
> ---
>   libavformat/mmsh.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)

Ok.

Patch

diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index 8a6de32..3761016 100644
--- a/libavformat/mmsh.c
+++ b/libavformat/mmsh.c
@@ -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)