it's better to close file and return on non-void function
authorThomas Debesse <dev@illwieckz.net>
Sat, 27 Jan 2018 21:04:11 +0000 (22:04 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sat, 27 Jan 2018 21:43:13 +0000 (22:43 +0100)
tools/quake3/common/vfs.c
tools/quake3/q3data/polyset.c

index 16a7828..4e38c94 100644 (file)
@@ -316,6 +316,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){
 
                f = fopen( filename, "rb" );
                if ( f == NULL ) {
+                       fclose( f );
                        return -1;
                }
 
index d8a9f61..fcfc52a 100644 (file)
@@ -89,6 +89,7 @@ polyset_t *Polyset_LoadSets( const char *file, int *numpolysets, int maxTrisPerS
        }
        else{
                Error( "TRI files no longer supported" );
+               return NULL;
        }
 //             TRI_LoadPolysets( file, &psets, numpolysets );