From 95dcd91e0572ea24877876de49ba0d2ef5b16348 Mon Sep 17 00:00:00 2001
From: Jean-Paul Saman <jpsaman@videolan.org>
Date: Tue, 10 Mar 2009 16:51:51 +0100
Subject: [PATCH] macosx: fix potential memleaks

---
 modules/gui/macosx/voutgl.m | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/macosx/voutgl.m b/modules/gui/macosx/voutgl.m
index 1347503748..e46cd8c040 100644
--- a/modules/gui/macosx/voutgl.m
+++ b/modules/gui/macosx/voutgl.m
@@ -138,6 +138,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         if( NULL == pixFormat )
         {
             msg_Err( p_vout, "no screen renderer available for required attributes." );
+            free( p_vout->p_sys );
             return VLC_EGENERIC;
         }
  
@@ -146,6 +147,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         if( NULL == p_vout->p_sys->agl_ctx )
         {
             msg_Err( p_vout, "cannot create AGL context." );
+            free( p_vout->p_sys );
             return VLC_EGENERIC;
         }
         else
@@ -177,6 +179,7 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         /* Check to see if initVout: was successfull */
         if( !p_vout->p_sys->o_vout_view )
         {
+            free( p_vout->p_sys );
             return VLC_EGENERIC;
         }
 
-- 
2.25.4