[x264-devel] matroska: Fix memory leak

Henrik Gramner git at videolan.org
Sun Jul 26 22:26:30 CEST 2015


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Tue Jun 23 13:38:02 2015 +0200| [df152a77e1b17065aecb40c9a2a28d5953887ac9] | committer: Anton Mitrofanov

matroska: Fix memory leak

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

 output/matroska.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/output/matroska.c b/output/matroska.c
index 51dea27..e5ab963 100644
--- a/output/matroska.c
+++ b/output/matroska.c
@@ -157,11 +157,11 @@ static int write_headers( hnd_t handle, x264_nal_t *p_nal )
                            avcC, avcC_len, p_mkv->frame_duration, 50000,
                            p_mkv->width, p_mkv->height,
                            p_mkv->d_width, p_mkv->d_height, p_mkv->display_size_units, p_mkv->stereo_mode );
+    free( avcC );
+
     if( ret < 0 )
         return ret;
 
-    free( avcC );
-
     // SEI
 
     if( !p_mkv->b_writing_frame )



More information about the x264-devel mailing list