[vlc-commits] commit: growl: fix pontential use after free ( var_delcallbacl called to late). ( Rémi Duraffort )

git at videolan.org git at videolan.org
Sat Apr 17 11:58:51 CEST 2010


vlc/vlc-1.0 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Mar 28 17:18:39 2010 +0200| [34f8c95b1830cbbc7bb4c995b8dd872abac045b8] | committer: Rémi Duraffort 

growl: fix pontential use after free (var_delcallbacl called to late).
(cherry picked from commit 0c33ffc1b394a41b099dbc7e949ba705d8d44e54)

Signed-off-by: Rémi Duraffort <ivoire at videolan.org>

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

 modules/misc/notify/growl.m |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/misc/notify/growl.m b/modules/misc/notify/growl.m
index 68e2754..9a410fe 100644
--- a/modules/misc/notify/growl.m
+++ b/modules/misc/notify/growl.m
@@ -135,15 +135,14 @@ static void Close( vlc_object_t *p_this )
 {
     intf_sys_t *p_sys = ((intf_thread_t*)p_this)->p_sys;
 
+    playlist_t *p_playlist = pl_Hold( p_this );
+    var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
+    pl_Release( p_this );
+
     CFRelease( p_sys->default_icon );
     CFRelease( p_sys->app_name );
     CFRelease( p_sys->notification_type );
     [p_sys->p_pool release];
-    free( p_sys );
-
-    playlist_t *p_playlist = pl_Hold( p_this );
-    var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
-    pl_Release( p_this );
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list