[vlc-commits] vobsub: fix memory leak

Rémi Duraffort git at videolan.org
Mon Dec 16 19:54:50 CET 2013


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Dec 16 19:39:55 2013 +0100| [3967c16b2bda94bbb4adcfdbf592be2eab2d2509] | committer: Rémi Duraffort

vobsub: fix memory leak

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

 modules/demux/vobsub.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index 780da72..5de3513 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -432,7 +432,10 @@ static int TextLoad( text_t *txt, stream_t *s )
         char **ppsz_new;
 
         if( psz == NULL || (n >= INT_MAX/sizeof(char *)) )
+        {
+            free( psz );
             break;
+        }
 
         ppsz_new = realloc( lines, (n + 1) * sizeof (char *) );
         if( ppsz_new == NULL )



More information about the vlc-commits mailing list