]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/common/vfs.c
Merge branch 'memoryfixes' into 'master'
[xonotic/netradiant.git] / tools / quake3 / common / vfs.c
index 4e38c9458a3153abedf69689b262e750e4afadff..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;
                                        }
                                }
@@ -316,7 +318,6 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
 
                f = fopen( filename, "rb" );
                if ( f == NULL ) {
-                       fclose( f );
                        return -1;
                }