mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avformat/cache: Fix memleak of tree entries
Found-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
24a189e016
commit
554f6e930c
@ -283,6 +283,12 @@ resolve_eof:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int enu_free(void *opaque, void *elem)
|
||||||
|
{
|
||||||
|
av_free(elem);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int cache_close(URLContext *h)
|
static int cache_close(URLContext *h)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
Context *c= h->priv_data;
|
||||||
@ -292,6 +298,7 @@ static int cache_close(URLContext *h)
|
|||||||
|
|
||||||
close(c->fd);
|
close(c->fd);
|
||||||
ffurl_close(c->inner);
|
ffurl_close(c->inner);
|
||||||
|
av_tree_enumerate(c->root, NULL, NULL, enu_free);
|
||||||
av_tree_destroy(c->root);
|
av_tree_destroy(c->root);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user