1
mirror of https://code.videolan.org/videolan/vlc synced 2024-07-21 07:24:15 +02:00

Fix memleaks (use vlclua_dir_list_free).

This commit is contained in:
Rémi Duraffort 2008-08-01 20:01:54 +02:00
parent 588723d7c6
commit 22dbf2bfad
2 changed files with 4 additions and 0 deletions

View File

@ -73,16 +73,19 @@ static char *FindFile( const char *psz_name )
if( asprintf( &psz_filename, "%s"DIR_SEP"%s.lua", *ppsz_dir,
psz_name ) < 0 )
{
vlclua_dir_list_free( ppsz_dir_list );
return NULL;
}
fp = fopen( psz_filename, "r" );
if( fp )
{
fclose( fp );
vlclua_dir_list_free( ppsz_dir_list );
return psz_filename;
}
free( psz_filename );
}
vlclua_dir_list_free( ppsz_dir_list );
return NULL;
}

View File

@ -162,6 +162,7 @@ static int vlclua_datadir_list( lua_State *L )
lua_rawseti( L, -2, i );
i ++;
}
vlclua_dir_list_free( ppsz_dir_list );
return 1;
}
/*****************************************************************************