vo/xcb: fix a memory leak in Open()
authorCan Wu <wu.canus@gmail.com>
Mon, 18 Jul 2011 10:57:24 +0000 (18:57 +0800)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 18 Jul 2011 14:52:43 +0000 (17:52 +0300)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/video_output/xcb/xvideo.c

index b7e0339..24d2345 100644 (file)
@@ -300,10 +300,11 @@ FindFormat (vout_display_t *vd,
 static int Open (vlc_object_t *obj)
 {
     vout_display_t *vd = (vout_display_t *)obj;
-    vout_display_sys_t *p_sys = malloc (sizeof (*p_sys));
+    vout_display_sys_t *p_sys;
 
     if (!var_InheritBool (obj, "overlay"))
         return VLC_EGENERIC;
+    p_sys = malloc (sizeof (*p_sys));
     if (p_sys == NULL)
         return VLC_ENOMEM;