Module: libav
Branch: master
Commit: 7915e6741dbe1cf3a8781cead3e68a7666de14f4

Author:    Vittorio Giovara <[email protected]>
Committer: Vittorio Giovara <[email protected]>
Date:      Thu Jan 22 20:13:44 2015 +0000

hlsproto: Properly close avio buffer in case of error

Fix a memory leak.

CC: [email protected]
Bug-Id: CID 717999

---

 libavformat/hlsproto.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index 751fef2..0eba049 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -121,8 +121,10 @@ static int parse_playlist(URLContext *h, const char *url)
         return ret;
 
     read_chomp_line(in, line, sizeof(line));
-    if (strcmp(line, "#EXTM3U"))
-        return AVERROR_INVALIDDATA;
+    if (strcmp(line, "#EXTM3U")) {
+        ret = AVERROR_INVALIDDATA;
+        goto fail;
+    }
 
     free_segment_list(s);
     s->finished = 0;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to