[vlc-devel] commit: Fix memleak in sdl video output. ( string passed to setenv have to be freed after). ( Rémi Duraffort )

git version control git at videolan.org
Thu Jul 31 14:35:58 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 31 14:38:49 2008 +0200| [98e9da7b1a9f9d4475189985ad21b1aad0c1d550]

Fix memleak in sdl video output. (string passed to setenv have to be freed after).

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

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

diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c
index cfd012d..0bc7de1 100644
--- a/modules/video_output/sdl.c
+++ b/modules/video_output/sdl.c
@@ -181,7 +181,7 @@ static int Open ( vlc_object_t *p_this )
     p_vout->pf_control = NULL;
 
 #ifdef HAVE_SETENV
-    psz_method = config_GetPsz( p_vout, "vout" );
+    char* psz = psz_method = config_GetPsz( p_vout, "vout" );
     if( psz_method )
     {
         while( *psz_method && *psz_method != ':' )
@@ -194,6 +194,7 @@ static int Open ( vlc_object_t *p_this )
             setenv( "SDL_VIDEODRIVER", psz_method + 1, 1 );
         }
     }
+    free( psz );
 #endif
 
     /* Initialize library */




More information about the vlc-devel mailing list