[vlc-commits] globalhotkeys/xcb: fix memory leaks
Rémi Denis-Courmont
git at videolan.org
Thu Dec 22 21:07:23 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Dec 22 22:03:33 2016 +0200| [edc3e0ba61a270651cff4ba4ae773e1d28bfcc30] | committer: Rémi Denis-Courmont
globalhotkeys/xcb: fix memory leaks
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=edc3e0ba61a270651cff4ba4ae773e1d28bfcc30
---
modules/control/globalhotkeys/xcb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c
index 712e880..5a3f298 100644
--- a/modules/control/globalhotkeys/xcb.c
+++ b/modules/control/globalhotkeys/xcb.c
@@ -159,11 +159,9 @@ static void Close( vlc_object_t *p_this )
vlc_cancel( p_sys->thread );
vlc_join( p_sys->thread, NULL );
- if( p_sys->p_map )
- {
- free( p_sys->p_map->p_keys );
- free( p_sys->p_map );
- }
+ for( int i = 0; i < p_sys->i_map; i++ )
+ free( p_sys->p_map[i].p_keys );
+ free( p_sys->p_map );
xcb_key_symbols_free( p_sys->p_symbols );
xcb_disconnect( p_sys->p_connection );
free( p_sys );
More information about the vlc-commits
mailing list