diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-03-14 17:32:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-03-14 22:07:27 +0100 |
commit | a4a98f15b29b32e561ac5d8dea0f027da1bde012 (patch) | |
tree | dab1b49bea62dc0344b4211e2072b6decb1e15eb | |
parent | 6fbc7f092e7c8d405f3fb38f0b550e12156601c4 (diff) | |
download | ffmpeg-a4a98f15b29b32e561ac5d8dea0f027da1bde012.tar.gz |
avformat/nutenc: Drop redundant frees
Should writing the header fail, the allocations already performed will
be freed during deinit so remove the frees in nut_write_header().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/nutenc.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 44773924dd..1d48625815 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -703,12 +703,8 @@ static int nut_write_header(AVFormatContext *s) nut->chapter = av_calloc(s->nb_chapters, sizeof(*nut->chapter)); nut->time_base= av_calloc(s->nb_streams + s->nb_chapters, sizeof(*nut->time_base)); - if (!nut->stream || !nut->chapter || !nut->time_base) { - av_freep(&nut->stream); - av_freep(&nut->chapter); - av_freep(&nut->time_base); + if (!nut->stream || !nut->chapter || !nut->time_base) return AVERROR(ENOMEM); - } for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; |