diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 8e85c0a8c02..ee1f0a3b081 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -1551,6 +1551,7 @@ void os::read_image_release_file() { fseek(file, 0, SEEK_END); long sz = ftell(file); if (sz == -1) { + fclose(file); return; } fseek(file, 0, SEEK_SET);