wtv: clean memory on error
authorVittorio Giovara <vittorio.giovara@gmail.com>
Sat, 18 Oct 2014 00:12:18 +0000 (01:12 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 20 Oct 2014 09:38:38 +0000 (10:38 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 718002

libavformat/wtv.c

index a3f8c27..ce0122d 100644 (file)
@@ -632,8 +632,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;
     }