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;