diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index db9bb10068..06050337fc 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -565,8 +565,10 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code if (!wst) return NULL; st = avformat_new_stream(s, NULL); - if (!st) + if (!st) { + av_free(wst); return NULL; + } st->id = sid; st->priv_data = wst; }