]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
q3map2/vfs: free temporary allocated dirlist when not used
authorThomas Debesse <dev@illwieckz.net>
Tue, 14 Jan 2020 06:28:50 +0000 (07:28 +0100)
committerThomas Debesse <dev@illwieckz.net>
Thu, 23 Jan 2020 18:21:39 +0000 (19:21 +0100)
tools/quake3/common/vfs.c

index 16a78289817b017de067257c6690ada8feed61b8..fbeda1a55281ef826a88f12f4d0421bfa2680407 100644 (file)
@@ -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;
                                        }
                                }