[vlc-devel] commit: Fix memleak (CID 210) ( Rémi Duraffort )
git version control
git at videolan.org
Sun Oct 5 19:25:55 CEST 2008
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Oct 5 19:25:28 2008 +0200| [10445c27d5faf698f95786401492be5dffcb615a] | committer: Rémi Duraffort
Fix memleak (CID 210)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=10445c27d5faf698f95786401492be5dffcb615a
---
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 932b897..0d9e673 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1655,12 +1655,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 )
@@ -1674,7 +1677,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