avformat/mpegtsenc: Use correct deallocation code on failure of pids array allocation
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 7 Aug 2014 20:40:24 +0000 (22:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 7 Aug 2014 21:02:10 +0000 (23:02 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpegtsenc.c

index 5c0b0d7..5ecc7fb 100644 (file)
@@ -623,8 +623,8 @@ static int mpegts_write_header(AVFormatContext *s)
 
     pids = av_malloc_array(s->nb_streams, sizeof(*pids));
     if (!pids) {
-        av_free(service);
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto fail;
     }
 
     /* assign pids to each stream */