]> git.sesse.net Git - ffmpeg/commitdiff
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 a3f8c2738855ed4a1d8044b426cae40efe6cf6e7..ce0122dc1c9ae2ff25dd2079536dd85ad8b6d9fa 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;
     }