[vlc-commits] tx3g: fix memory leak

Hannes Domani git at videolan.org
Tue Mar 29 07:09:08 CEST 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Sun Mar 27 16:36:50 2016 +0200| [904631f7e923b40ba4db6e01dae734a864755f04] | committer: Jean-Baptiste Kempf

tx3g: fix memory leak

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/substx3g.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/substx3g.c b/modules/codec/substx3g.c
index f691aac..f38a61c 100644
--- a/modules/codec/substx3g.c
+++ b/modules/codec/substx3g.c
@@ -321,11 +321,12 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     if ( p_dec->fmt_in.subs.p_style )
         p_segment3g->s->style = text_style_Duplicate( p_dec->fmt_in.subs.p_style );
 
+    free( psz_subtitle );
+
     if ( !p_segment3g->s->psz_text )
     {
         text_segment_Delete( p_segment3g->s );
         free( p_segment3g );
-        free( psz_subtitle );
         return NULL;
     }
 
@@ -333,7 +334,6 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     p_spu = decoder_NewSubpictureText( p_dec );
     if( !p_spu )
     {
-        free( psz_subtitle );
         text_segment_Delete( p_segment3g->s );
         free( p_segment3g );
         return NULL;



More information about the vlc-commits mailing list