dcavalca / rpms / linuxptp

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