From 4f1f5cba0644d4669d465d9b71f30227b6503499 Mon Sep 17 00:00:00 2001 From: rraghavan Date: Mon, 28 Mar 2016 20:38:05 -0700 Subject: [PATCH] 8152730: File Leak in CompileBroker::init_compiler_thread_log of compileBroker.cpp:1665. Summary: Added missing code to close file pointer. Reviewed-by: kvn --- src/share/vm/compiler/compileBroker.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/share/vm/compiler/compileBroker.cpp b/src/share/vm/compiler/compileBroker.cpp index dad99ec0e..32a753c65 100644 --- a/src/share/vm/compiler/compileBroker.cpp +++ b/src/share/vm/compiler/compileBroker.cpp @@ -1851,6 +1851,10 @@ void CompileBroker::init_compiler_thread_log() { 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) { -- GitLab