[vlc-commits] demux: subtitle: Fix leaks

Hugo Beauzée-Luyssen git at videolan.org
Wed Aug 2 16:41:51 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Aug  2 16:36:08 2017 +0200| [5ec65af26b3312310318e970fd940dcaf2752b07] | committer: Hugo Beauzée-Luyssen

demux: subtitle: Fix leaks

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

 modules/demux/subtitle.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index cf3e4c30c2..fd3b7b77a2 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -320,7 +320,10 @@ static int Open ( vlc_object_t *p_this )
     size_t i_peek;
     const uint8_t *p_peek;
     if( vlc_stream_Peek( p_demux->s, &p_peek, 16 ) < 16 )
+    {
+        free( p_sys );
         return VLC_EGENERIC;
+    }
 
     enum
     {
@@ -356,7 +359,10 @@ static int Open ( vlc_object_t *p_this )
 
     i_peek = vlc_stream_Peek( p_demux->s, &p_peek, i_peek );
     if( unlikely(i_peek < 16) )
+    {
+        free( p_sys );
         return VLC_EGENERIC;
+    }
 
     stream_t *p_probestream = NULL;
     if( e_bom != UTF8BOM && e_bom != NOBOM )
@@ -396,7 +402,10 @@ static int Open ( vlc_object_t *p_this )
     }
 
     if( p_probestream == NULL )
+    {
+        free( p_sys );
         return VLC_EGENERIC;
+    }
 
     /* Probe if unknown type */
     if( p_sys->props.i_type == SUB_TYPE_UNKNOWN )



More information about the vlc-commits mailing list