From f6a2bf28e1c000ce4ca7eb45677e6d5a218f7dfb Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 11 Mar 2022 03:07:50 -0500 Subject: [PATCH] BUGFIX file.c open failure leaves open file handle Change-Id: Iad8eef2f65af0549da4dbec654c85adb2f325711 --- firmware/common/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firmware/common/file.c b/firmware/common/file.c index 794d0059a9..a204cf71cc 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -494,6 +494,8 @@ static int open_internal_inner1(const char *path, int oflag, return fildes; file_error: + if (fildes >= 0) + close(fildes); return rc; }