diff --git a/lib/filesys.cpp b/lib/filesys.cpp index a16c46a051..6535a80433 100644 --- a/lib/filesys.cpp +++ b/lib/filesys.cpp @@ -505,6 +505,7 @@ FILE* boinc_fopen(const char* path, const char* mode) { } if (f) { if (-1 == fcntl(fileno(f), F_SETFD, FD_CLOEXEC)) { + fclose(f); return 0; } }