diff --git a/libavformat/md5proto.c b/libavformat/md5proto.c index 653bf10e66..4cf5c3d386 100644 --- a/libavformat/md5proto.c +++ b/libavformat/md5proto.c @@ -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; }