From 35b8ead7cee0681fb2176ad37e3545cc2c03378a Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 14 Jan 2020 07:28:50 +0100 Subject: [PATCH] q3map2/vfs: free temporary allocated dirlist when not used --- tools/quake3/common/vfs.c | 2 ++ 1 file changed, 2 insertions(+) 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; } } -- 2.39.2