[MPlayer-cvslog] r38272 - trunk/gui/dialog/skinbrowser.c

ib subversion at mplayerhq.hu
Fri Feb 26 16:30:29 EET 2021


Author: ib
Date: Fri Feb 26 16:30:29 2021
New Revision: 38272

Log:
Fix memory leak.

FillSkinList() is called twice without gtkOldSkin being freed meanwhile.
Since skinName remains unchanged all the time, it can be used directly
instead.

Modified:
   trunk/gui/dialog/skinbrowser.c

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Fri Feb 26 16:27:48 2021	(r38271)
+++ trunk/gui/dialog/skinbrowser.c	Fri Feb 26 16:30:29 2021	(r38272)
@@ -40,7 +40,6 @@ char      * sbSelectedSkin=NULL;
 char      * sbSkinDirInHome=NULL;
 char      * sbSkinDirInData=NULL;
 
-char * gtkOldSkin=NULL;
 static char * prev=NULL;
 
 GtkWidget * SkinBrowser = NULL;
@@ -54,7 +53,7 @@ static void prButton( GtkButton * button
   switch ( GPOINTER_TO_INT(user_data) )
    {
     case 0: // cancel
-      if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) uiChangeSkin( gtkOldSkin );
+      if ( strcmp( sbSelectedSkin,skinName ) ) uiChangeSkin( skinName );
       break;
    case 1: // ok
       uiChangeSkin( sbSelectedSkin );   // NOTE TO MYSELF: skin already changed!
@@ -166,8 +165,7 @@ int FillSkinList( gchar * mdir )
  glob_t          gg;
  struct stat     fs;
 
- gtkOldSkin=strdup( skinName );
- prev=gtkOldSkin;
+ prev=skinName;
 
  glob( mdir,GLOB_NOSORT,NULL,&gg );
  for( i=0;i<gg.gl_pathc;i++ )


More information about the MPlayer-cvslog mailing list