changeset 10302:046cdd3a4173

8150379: [windows] Fix Leaks in perfMemory_windows.cpp Reviewed-by: clanger, dholmes, gthornbr
author stuefe
date Tue, 23 Feb 2016 19:10:01 -0500
parents d015eb5b230c
children e389b96f65cd 8750312a7452
files src/os/windows/vm/perfMemory_windows.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/windows/vm/perfMemory_windows.cpp	Tue Feb 23 14:14:29 2016 +0100
+++ b/src/os/windows/vm/perfMemory_windows.cpp	Tue Feb 23 19:10:01 2016 -0500
@@ -628,6 +628,7 @@
 
   if (!is_directory_secure(dirname)) {
     // the directory is not secure, don't attempt any cleanup
+    os::closedir(dirp);
     return;
   }
 
@@ -1445,6 +1446,8 @@
 
   // check that the file system is secure - i.e. it supports ACLs.
   if (!is_filesystem_secure(dirname)) {
+    FREE_C_HEAP_ARRAY(char, dirname);
+    FREE_C_HEAP_ARRAY(char, user);
     return NULL;
   }
 
@@ -1624,6 +1627,7 @@
   //
   if (!is_directory_secure(dirname)) {
     FREE_C_HEAP_ARRAY(char, dirname);
+    if (luser != user) FREE_C_HEAP_ARRAY(char, luser);
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Process not found");
   }