From 25f3ffb32660f32e4cffd3302768b214492b44d6 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sat, 27 Jan 2018 22:04:11 +0100 Subject: [PATCH] it's better to close file and return on non-void function --- tools/quake3/common/vfs.c | 1 + tools/quake3/q3data/polyset.c | 1 + 2 files changed, 2 insertions(+) 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 ); -- 2.39.2