[vlc-devel] commit: Fix use after free : CID 134 ( Rafaël Carré )

git version control git at videolan.org
Fri May 30 15:11:11 CEST 2008


vlc | branch: 0.8.6-bugfix | Rafaël Carré <funman at videolan.org> | Fri May 30 15:12:49 2008 +0200| [ab9eb7bfde118b289ad96e6724d14fa6db3c69c3]

Fix use after free : CID 134

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

 modules/video_filter/marq.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/marq.c b/modules/video_filter/marq.c
index f29cfa3..c9dafc7 100644
--- a/modules/video_filter/marq.c
+++ b/modules/video_filter/marq.c
@@ -194,9 +194,8 @@ static void DestroyFilter( vlc_object_t *p_this )
     filter_t *p_filter = (filter_t *)p_this;
     filter_sys_t *p_sys = p_filter->p_sys;
 
-    if( p_sys->p_style ) free( p_sys->p_style );
-    if( p_sys->psz_marquee ) free( p_sys->psz_marquee );
-    free( p_sys );
+    free( p_sys->p_style );
+    free( p_sys->psz_marquee );
 
     /* Delete the marquee variables */
     var_DelCallback( p_filter->p_libvlc, "marq-x", MarqueeCallback, p_sys );
@@ -216,6 +215,8 @@ static void DestroyFilter( vlc_object_t *p_this )
     var_Destroy( p_filter->p_libvlc , "marq-color");
     var_Destroy( p_filter->p_libvlc , "marq-opacity");
     var_Destroy( p_filter->p_libvlc , "marq-size");
+
+    free( p_sys );
 }
 
 /****************************************************************************




More information about the vlc-devel mailing list