[vlc-devel] commit: Fix memleak in mkv. ( Rémi Duraffort )

git version control git at videolan.org
Tue Aug 12 23:08:47 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Aug 12 23:10:57 2008 +0200| [9b868a2f52eef2eb456831d296428aac98419bca] | committer: Rémi Duraffort 

Fix memleak in mkv.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b868a2f52eef2eb456831d296428aac98419bca
---

 modules/demux/mkv.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp
index ceaa77a..2f73619 100644
--- a/modules/demux/mkv.cpp
+++ b/modules/demux/mkv.cpp
@@ -5079,7 +5079,9 @@ void matroska_segment_c::ParseAttachments( KaxAttachments *attachments )
 
         if( new_attachment )
         {
-            new_attachment->psz_file_name  = ToUTF8( UTFstring( file_name ) );
+            char* tmp = ToUTF8( UTFstring( file_name ) );
+            new_attachment->psz_file_name  = tmp;
+            free( tmp );
             new_attachment->psz_mime_type  = psz_mime_type;
             new_attachment->i_size         = img_data.GetSize();
             new_attachment->p_data         = malloc( img_data.GetSize() );




More information about the vlc-devel mailing list