aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--FICS/makerank.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/FICS/makerank.c b/FICS/makerank.c
index 70fe7ea..5f1f2f5 100644
--- a/FICS/makerank.c
+++ b/FICS/makerank.c
@@ -39,8 +39,11 @@ GetPlayerInfo(char *fileName, ENTRY *e)
if ((fp = fopen(fileName, "r")) == NULL ||
fgets(line, sizeof line, fp) == NULL ||
- feof(fp))
+ feof(fp)) {
+ if (fp)
+ fclose(fp);
return 0;
+ }
if (!strcmp(line, "v 1\n")) {
fgets(line, sizeof line, fp);