dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-fclose.patch

1a36a3
commit e8a82d1b5be2d5bf9450a9acfe44e957b4867870
1a36a3
Author: Miroslav Lichvar <mlichvar@redhat.com>
1a36a3
Date:   Tue Jul 20 11:41:35 2021 +0200
1a36a3
1a36a3
    lstab: Close file after reading.
1a36a3
    
1a36a3
    The lstab_read() function opens a file, but doesn't close it after use.
1a36a3
    
1a36a3
    Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
1a36a3
1a36a3
diff --git a/lstab.c b/lstab.c
1a36a3
index e6e7ad2..0d6a427 100644
1a36a3
--- a/lstab.c
1a36a3
+++ b/lstab.c
1a36a3
@@ -144,6 +144,7 @@ static int lstab_read(struct lstab *lstab, const char *name)
1a36a3
 			index++;
1a36a3
 		}
1a36a3
 	}
1a36a3
+	fclose(fp);
1a36a3
 	if (!lstab->expiration_utc) {
1a36a3
 		fprintf(stderr, "missing expiration date in '%s'\n", name);
1a36a3
 		return -1;