diff options
author | Zhao Zhili <quinkblack@foxmail.com> | 2020-06-28 11:15:39 +0800 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-01 15:28:03 +0200 |
commit | f3dc38a186b2326ce03e50969897ea703817ddb0 (patch) | |
tree | 77610ec55de0115ef266726df209a1e6c90cbbeb | |
parent | 61f5c6ab06fc61e0f9f8f8dab5595b8bb202df73 (diff) |
avformat/mov: fix memleaks
Fix two cases of memleaks:
1. The leak of dv_demux
2. The leak of dv_fctx upon dv_demux allocate failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 8be01dd66b..df5bebdff1 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7357,10 +7357,9 @@ static int mov_read_close(AVFormatContext *s) av_freep(&sc->coll); } - if (mov->dv_demux) { - avformat_free_context(mov->dv_fctx); - mov->dv_fctx = NULL; - } + av_freep(&mov->dv_demux); + avformat_free_context(mov->dv_fctx); + mov->dv_fctx = NULL; if (mov->meta_keys) { for (i = 1; i < mov->meta_keys_count; i++) { |