]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dashdec: Fix memleak when resolve_content_path
authorJacek Jendrzej <overx300@gmail.com>
Tue, 7 Aug 2018 03:32:05 +0000 (11:32 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Tue, 7 Aug 2018 04:31:55 +0000 (12:31 +0800)
Can be reproduced with:  valgrind  --leak-check=full  -v ffmpeg -i
http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/dashdec.c

index f0939f44255151b51d914864c6864bcc5f1e905d..c710e567278bbc5c681dd12e37bfdea0e5e4a675 100644 (file)
@@ -754,9 +754,12 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
         if (!(node = baseurl_nodes[rootId])) {
             continue;
         }
-        if (ishttp(xmlNodeGetContent(node))) {
+        text = xmlNodeGetContent(node);
+        if (ishttp(text)) {
+            xmlFree(text);
             break;
         }
+        xmlFree(text);
     }
 
     node = baseurl_nodes[rootId];