dcavalca / rpms / linuxptp

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