]> git.sesse.net Git - vlc/commitdiff
Fix memleak in sdl video output. (string passed to setenv have to be freed after).
authorRémi Duraffort <ivoire@videolan.org>
Thu, 31 Jul 2008 12:38:49 +0000 (14:38 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 31 Jul 2008 12:38:49 +0000 (14:38 +0200)
modules/video_output/sdl.c

index cfd012dfb62f30cf723778ffc09efd74eeead5a4..0bc7de17d5a14157aef0ac80fd7f454adaded16d 100644 (file)
@@ -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 */