From: Thomas Debesse Date: Sat, 27 Jan 2018 21:04:11 +0000 (+0100) Subject: it's better to close file and return on non-void function X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=25f3ffb32660f32e4cffd3302768b214492b44d6 it's better to close file and return on non-void function --- diff --git a/tools/quake3/common/vfs.c b/tools/quake3/common/vfs.c index 16a78289..4e38c945 100644 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@ -316,6 +316,7 @@ int vfsLoadFile( const char *filename, void **bufferptr, int index ){ f = fopen( filename, "rb" ); if ( f == NULL ) { + fclose( f ); return -1; } diff --git a/tools/quake3/q3data/polyset.c b/tools/quake3/q3data/polyset.c index d8a9f617..fcfc52a9 100644 --- a/tools/quake3/q3data/polyset.c +++ b/tools/quake3/q3data/polyset.c @@ -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 );