From e47024d72f326f7a76c9df90da861663fc5d5fc2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 13 Oct 2012 02:37:47 +0200 Subject: [PATCH] wtvdec: fix memleak on error Fixes CID718002 Signed-off-by: Michael Niedermayer --- libavformat/wtvdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 319b986ab4..a8dc506e84 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -580,8 +580,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; }