[vlc-devel] commit: Fix memleaks (CID 211) ( Rémi Duraffort )

git version control git at videolan.org
Wed Oct 1 21:18:03 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Oct  1 21:17:48 2008 +0200| [6c79686bfe98e4731aac1118df7004182c20ab45] | committer: Rémi Duraffort 

Fix memleaks (CID 211)

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

 modules/demux/subtitle.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 485ae29..963181b 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1463,7 +1463,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
 
         const char *s = TextGetLine( txt );
         if( !s )
+        {
+            free( psz_text );
             return VLC_EGENERIC;
+        }
 
         if( strstr( s, "FORMAT" ) )
         {
@@ -1475,7 +1478,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
 
             psz_temp = malloc( strlen(s) );
             if( !psz_temp )
+            {
+                free( psz_text );
                 return VLC_ENOMEM;
+            }
 
             if( sscanf( s, "FORMAT=%[^\r\n]", psz_temp ) )
             {
@@ -1508,7 +1514,10 @@ static int ParseMPSub( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
         const char *s = TextGetLine( txt );
 
         if( !s )
+        {
+            free( psz_text );
             return VLC_EGENERIC;
+        }
 
         int i_len = strlen( s );
         if( i_len == 0 )




More information about the vlc-devel mailing list