From 12b59e57f3d7a37ef7b29d8a1df5eb886b00b4ba Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 7 Aug 2014 22:40:24 +0200 Subject: [PATCH] avformat/mpegtsenc: Use correct deallocation code on failure of pids array allocation Signed-off-by: Michael Niedermayer --- libavformat/mpegtsenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 5c0b0d761e..5ecc7fb447 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -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 */