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; }