[vlc-devel] commit: Fix memleak (CID 210) ( Rémi Duraffort )

git version control git at videolan.org
Mon Oct 6 15:46:47 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Sun Oct  5 19:25:28 2008 +0200| [ab78b098bb32a626090cd7cb660cc2afb684a037] | committer: Derk-Jan Hartman 

Fix memleak (CID 210)
(cherry picked from commit 10445c27d5faf698f95786401492be5dffcb615a)

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

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

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 68a8f05..68fbf89 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1651,12 +1651,15 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
         }
     }
 	
-	while( psz_text[ strlen( psz_text ) - 1 ] == '\\' )
-	{
+    while( psz_text[ strlen( psz_text ) - 1 ] == '\\' )
+    {
         const char *s2 = TextGetLine( txt );
 
         if( !s2 )
+        {
+            free( psz_orig );
             return VLC_EGENERIC;
+        }
 
         int i_len = strlen( s2 );
         if( i_len == 0 )
@@ -1670,7 +1673,7 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
 
 		psz_orig = psz_text;
         strcat( psz_text, s2 );
-	}
+    }
 
     /* Skip the blanks */
     while( *psz_text == ' ' || *psz_text == '\t' ) psz_text++;




More information about the vlc-devel mailing list