]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
fclose when fopen actually succeeds
authorDale Weiler <weilercdale@gmail.com>
Fri, 26 Mar 2021 23:02:27 +0000 (19:02 -0400)
committerDale Weiler <weilercdale@gmail.com>
Fri, 26 Mar 2021 23:02:27 +0000 (19:02 -0400)
main.cpp

index 1080f8f7fde7f1cf20619c8a1bdb7f3682f246af..eace1d5d72a51026f520e29d6d0be6121a1ea5bb 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -631,8 +631,8 @@ int main(int argc, char **argv) {
       FILE *fp = fopen(OPTS_OPTION_STR(OPTION_PROGSRC), "rb");
       if (fp) {
         has_progs_src = true;
+        fclose(fp);
       }
-      fclose(fp);
     }
 
     if (has_progs_src) {