summaryrefslogtreecommitdiff
path: root/libavformat/cache.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-03-02 14:09:23 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-02 14:27:57 +0100
commit554f6e930ce05a4c5449efcaae36bdafe2d9de74 (patch)
treed0185fbe2f286c9c2ecbbe397a1e7fc303cf2051 /libavformat/cache.c
parent24a189e01647bf78181561c29addcd4f26165ac5 (diff)
avformat/cache: Fix memleak of tree entries
Found-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/cache.c')
-rw-r--r--libavformat/cache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/cache.c b/libavformat/cache.c
index 2889e3b2a8..59d7fe6bdf 100644
--- a/libavformat/cache.c
+++ b/libavformat/cache.c
@@ -283,6 +283,12 @@ resolve_eof:
return ret;
}
+static int enu_free(void *opaque, void *elem)
+{
+ av_free(elem);
+ return 0;
+}
+
static int cache_close(URLContext *h)
{
Context *c= h->priv_data;
@@ -292,6 +298,7 @@ static int cache_close(URLContext *h)
close(c->fd);
ffurl_close(c->inner);
+ av_tree_enumerate(c->root, NULL, NULL, enu_free);
av_tree_destroy(c->root);
return 0;