From 0cf5e6b5b4e162efd71e0e331b0aa87d903517e3 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 7 Aug 2018 11:32:05 +0800 Subject: [PATCH] avformat/dashdec: Fix memleak when resolve_content_path 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 Signed-off-by: Steven Liu --- libavformat/dashdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index f0939f4425..c710e56727 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -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];