[FFmpeg-cvslog] avformat/ffmenc: Fix memleak of buf

Michael Niedermayer git at videolan.org
Wed Feb 18 14:42:17 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 18 14:30:15 2015 +0100| [c8c10a5fc753af376eaca2c7d5b3cc5a4375f8ac] | committer: Michael Niedermayer

avformat/ffmenc: Fix memleak of buf

Fixes CID1257015

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c8c10a5fc753af376eaca2c7d5b3cc5a4375f8ac
---

 libavformat/ffmenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index e6d1a31..cacf0d7 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -146,8 +146,8 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, AVCodecContext *ctx, unsi
         if (need_coma)
             avio_w8(tmp, ',');
         avio_write(tmp, buf, strlen(buf));
-        av_free(buf);
     }
+    av_freep(&buf);
     avio_w8(tmp, 0);
     write_header_chunk(pb, tmp, tag);
     return 0;



More information about the ffmpeg-cvslog mailing list