Don't leak file descriptors in GetFileAttributesA polyfill (#372)

This commit is contained in:
Anonymous Maarten 2024-06-20 00:22:34 +02:00 committed by GitHub
parent 5a9579143b
commit a74ee0ac82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -26,9 +26,10 @@
uint32_t GetFileAttributesA_(char* lpFileName) {
FILE* f = fopen(lpFileName, "r");
if (!f) {
if (f == NULL) {
return INVALID_FILE_ATTRIBUTES;
}
fclose(f);
return FILE_ATTRIBUTE_NORMAL;
}