[2/7] applehttpproto: Use the close function if the open function fails

Message ID 1322734056-84812-2-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö Dec. 1, 2011, 10:07 a.m.
This should clean up leaked memory.
---
 libavformat/applehttpproto.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Luca Barbato Dec. 1, 2011, 10:49 a.m. | #1
On 01/12/11 11:07, Martin Storsjö wrote:
> This should clean up leaked memory.

I'd squash it with 1/7, otherwise it would look strange.

(both patches ok)

lu

Patch

diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c
index 82b9985..8dbcf2d 100644
--- a/libavformat/applehttpproto.c
+++ b/libavformat/applehttpproto.c
@@ -240,7 +240,7 @@  static int applehttp_open(URLContext *h, const char *uri, int flags)
     return 0;
 
 fail:
-    av_free(s);
+    applehttp_close(h);
     return ret;
 }