dcavalca / rpms / linuxptp

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