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: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=35b8ead7cee0681fb2176ad37e3545cc2c03378a 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; } }