BUGFIX file.c open failure leaves open file handle

Change-Id: Iad8eef2f65af0549da4dbec654c85adb2f325711
This commit is contained in:
William Wilgus 2022-03-11 03:07:50 -05:00 committed by William Wilgus
parent 68d0175172
commit f6a2bf28e1

View file

@ -494,6 +494,8 @@ static int open_internal_inner1(const char *path, int oflag,
return fildes; return fildes;
file_error: file_error:
if (fildes >= 0)
close(fildes);
return rc; return rc;
} }