From: Thomas Debesse Date: Tue, 14 Jan 2020 06:28:50 +0000 (+0100) Subject: q3map2/vfs: free temporary allocated dirlist when not used X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=35b8ead7cee0681fb2176ad37e3545cc2c03378a;p=xonotic%2Fnetradiant.git q3map2/vfs: free temporary allocated dirlist when not used --- diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index 16a78289..fbeda1a5 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -229,6 +229,7 @@ void vfsInitDirectory( const char *path ){ if ( ext != NULL && ( !Q_stricmp( ext, ".pk3dir" ) || !Q_stricmp( ext, ".dpkdir" ) ) ) { if ( g_numDirs == VFS_MAXDIRS ) { + g_free( dirlist ); continue; } snprintf( g_strDirs[g_numDirs], PATH_MAX, "%s/%s", path, name ); @@ -239,6 +240,7 @@ void vfsInitDirectory( const char *path ){ } if ( ext == NULL || ( Q_stricmp( ext, ".pk3" ) != 0 && Q_stricmp( ext, ".dpk" ) != 0 ) ) { + g_free( dirlist ); continue; } }