changeset 8317:865c2c3bbf3d

8152730: File Leak in CompileBroker::init_compiler_thread_log of compileBroker.cpp:1665. Summary: Added missing code to close file pointer. Reviewed-by: kvn
author rraghavan
date Mon, 28 Mar 2016 20:38:05 -0700
parents 2198ef7e1c17
children 90faa4a4b09f
files src/share/vm/compiler/compileBroker.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Aug 18 14:31:02 2016 -0700
+++ b/src/share/vm/compiler/compileBroker.cpp	Mon Mar 28 20:38:05 2016 -0700
@@ -1851,6 +1851,10 @@
           tty->print_cr("Opening compilation log %s", file_name);
         }
         CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file_name, fp, thread_id);
+        if (log == NULL) {
+          fclose(fp);
+          return;
+        }
         thread->init_log(log);
 
         if (xtty != NULL) {