From 32eb7b39fe78db39fcbcfa10890163661189dfd4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 26 Jan 2015 23:30:13 +0100 Subject: [PATCH] macloader: Close file when we don't need it anymore. Change-Id: Ib539b45ed45f1dcfc9eea0475adb9c50d17011b5 Signed-off-by: Andreas Schneider --- macloader/macloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macloader/macloader.c b/macloader/macloader.c index 1ca1cba..c7aa713 100644 --- a/macloader/macloader.c +++ b/macloader/macloader.c @@ -59,6 +59,7 @@ int main() { /* get and compare mac addr */ str = fgets(mac_addr_half, 9, file); + fclose(file); if (str == 0) { fprintf(stderr, "fgets() from file %s failed\n", MACADDR_PATH); ALOGE("Can't read from %s\n", MACADDR_PATH); @@ -186,6 +187,5 @@ int main() { ALOGD("Deleting file %s\n", CID_PATH); remove(CID_PATH); } - fclose(file); return 0; } -- 2.20.1