[vlc-commits] vo/xcb: fix a memory leak in Open()

Can Wu git at videolan.org
Mon Jul 18 16:52:55 CEST 2011


vlc | branch: master | Can Wu <wu.canus at gmail.com> | Mon Jul 18 18:57:24 2011 +0800| [be82d4c1415c9490ecdccdd4bb2b61cd69499365] | committer: Rémi Denis-Courmont

vo/xcb: fix a memory leak in Open()

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/video_output/xcb/xvideo.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index b7e0339..24d2345 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -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;
 



More information about the vlc-commits mailing list