Don't leak file descriptors in GetFileAttributesA polyfill (#372)
This commit is contained in:
parent
5a9579143b
commit
a74ee0ac82
|
@ -26,9 +26,10 @@
|
||||||
uint32_t GetFileAttributesA_(char* lpFileName) {
|
uint32_t GetFileAttributesA_(char* lpFileName) {
|
||||||
|
|
||||||
FILE* f = fopen(lpFileName, "r");
|
FILE* f = fopen(lpFileName, "r");
|
||||||
if (!f) {
|
if (f == NULL) {
|
||||||
return INVALID_FILE_ATTRIBUTES;
|
return INVALID_FILE_ATTRIBUTES;
|
||||||
}
|
}
|
||||||
|
fclose(f);
|
||||||
return FILE_ATTRIBUTE_NORMAL;
|
return FILE_ATTRIBUTE_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue