mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avformat/md5proto: free the MD5 context when opening the output fails
This is not a security issue. Fixes: ORPoDnVi3BLg Fixes: swarm-MD5-context-leaked-when-output-URL-open-fails-e4415f Found-by: zhang xingxing <2388969553@qq.com> Memory leak Replicated through UnModified FFmpeg with LSAN Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
f02f1707b1
commit
0ff8cac632
@@ -62,6 +62,7 @@ static int md5_close(URLContext *h)
|
||||
int err = 0;
|
||||
|
||||
av_md5_final(c->md5, md5);
|
||||
av_freep(&c->md5);
|
||||
ff_data_to_hex(buf, md5, sizeof(md5), 1);
|
||||
buf[2 * sizeof(md5)] = '\n';
|
||||
|
||||
@@ -80,8 +81,6 @@ static int md5_close(URLContext *h)
|
||||
err = AVERROR(errno);
|
||||
}
|
||||
|
||||
av_freep(&c->md5);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user