diff --git a/libavformat/riff.c b/libavformat/riff.c index 8c4d797e93..ea598d272e 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -715,8 +715,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) AV_WL32(key, chunk_code); if (avio_read(pb, value, chunk_size) != chunk_size) { - av_freep(key); - av_freep(value); + av_freep(&value); av_log(s, AV_LOG_ERROR, "premature end of file while reading INFO tag\n"); return AVERROR_INVALIDDATA; }