diff options
author | Zhao Zhili <quinkblack@foxmail.com> | 2020-06-28 06:15:39 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-01 22:39:24 +0300 |
commit | 6b0276f05ee0ee7c7cb76d381fe3e27cae806205 (patch) | |
tree | a94b0ffe427ab943e927b9e8c6ea2511b8b34d6b /libavformat/mov.c | |
parent | b1d8fac858870964da27729569d650415db7dabd (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>
(cherry picked from commit f3dc38a186b2326ce03e50969897ea703817ddb0)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/mov.c')
-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 ecaf692546..da2164e408 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7236,10 +7236,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++) { |