Skip to content

Commit

Permalink
Don't leak file descriptors in GetFileAttributesA polyfill (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr authored Jun 19, 2024
1 parent 5a95791 commit a74ee0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/harness/win95/polyfill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a74ee0a

Please sign in to comment.