]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
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 16a78289817b017de067257c6690ada8feed61b8..4e38c9458a3153abedf69689b262e750e4afadff 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 d8a9f617ec07d895e3d8e4df7774f076f1cd7528..fcfc52a93d4d2fa0ad4f7b04e6a836c5bac86784 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 );