diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 9c4d036043..eca4dfed9c 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -866,6 +866,7 @@ static inline int mxf_read_utf16_string(AVIOContext *pb, int size, char** str, i return AVERROR(EINVAL); buf_size = size + size / 2 + 1; + av_free(*str); *str = av_malloc(buf_size); if (!*str) return AVERROR(ENOMEM);