]> git.sesse.net Git - vlc/blobdiff - modules/video_output/sdl.c
Fix memleak in sdl video output. (string passed to setenv have to be freed after).
[vlc] / modules / video_output / sdl.c
index 97f326cc349e767fba640e2d7b6815625b35b711..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 */
@@ -432,9 +433,6 @@ static int Manage( vout_thread_t *p_vout )
             {
             case SDL_BUTTON_LEFT:
                 {
-                    playlist_t *p_playlist;
-                    vlc_value_t val;
-
                     var_Get( p_vout, "mouse-button-down", &val );
                     val.i_int &= ~1;
                     var_Set( p_vout, "mouse-button-down", val );
@@ -449,8 +447,6 @@ static int Manage( vout_thread_t *p_vout )
 
             case SDL_BUTTON_MIDDLE:
                 {
-                    playlist_t *p_playlist;
-
                     var_Get( p_vout, "mouse-button-down", &val );
                     val.i_int &= ~2;
                     var_Set( p_vout, "mouse-button-down", val );
@@ -465,7 +461,6 @@ static int Manage( vout_thread_t *p_vout )
             case SDL_BUTTON_RIGHT:
                 {
                     intf_thread_t *p_intf;
-                    playlist_t *p_playlist;
 
                     var_Get( p_vout, "mouse-button-down", &val );
                     val.i_int &= ~4;
@@ -523,7 +518,7 @@ static int Manage( vout_thread_t *p_vout )
                 if( p_playlist != NULL )
                 {
                     playlist_Stop( p_playlist );
-                    pl_Release( p_playlist );
+                    pl_Release( p_vout );
                 }
 #else
 #warning FIXME FIXME ?