dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-fclose.patch

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