dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone

Blame SOURCES/linuxptp-fclose.patch

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