Skip to content

Commit a74ee0a

Browse files
authored
Don't leak file descriptors in GetFileAttributesA polyfill (#372)
1 parent 5a95791 commit a74ee0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/harness/win95/polyfill.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
uint32_t GetFileAttributesA_(char* lpFileName) {
2727

2828
FILE* f = fopen(lpFileName, "r");
29-
if (!f) {
29+
if (f == NULL) {
3030
return INVALID_FILE_ATTRIBUTES;
3131
}
32+
fclose(f);
3233
return FILE_ATTRIBUTE_NORMAL;
3334
}
3435

0 commit comments

Comments
 (0)