diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-02 14:09:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-04-29 14:23:40 +0200 |
commit | 20196b6abd66e08e1511c5c3b8687329940f702e (patch) | |
tree | f27b1f845af7b0ddf65ecf00d5808811494c4294 /libavformat | |
parent | 578e4998641cb6272e300a70c881d66f5dd414e0 (diff) | |
download | ffmpeg-20196b6abd66e08e1511c5c3b8687329940f702e.tar.gz |
avformat/cache: Fix memleak of tree entries
Found-by: jamrial
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 554f6e930ce05a4c5449efcaae36bdafe2d9de74)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/cache.c b/libavformat/cache.c index d3d12bb4d5..7cb6c22b36 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -282,6 +282,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; @@ -291,6 +297,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; |