hotspot/src/os/aix/vm/perfMemory_aix.cpp
changeset 27471 6e56277909f1
parent 27007 3cacf4ad4fc9
child 27880 afb974a04396
child 27685 26a697375de3
--- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp	Mon Nov 03 11:34:13 2014 -0800
+++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp	Wed Oct 29 10:13:24 2014 +0100
@@ -506,6 +506,7 @@
 
   if (!is_directory_secure(dirname)) {
     // the directory is not a secure directory
+    os::closedir(dirp);
     return;
   }
 
@@ -853,6 +854,9 @@
   //
   if (!is_directory_secure(dirname)) {
     FREE_C_HEAP_ARRAY(char, dirname, mtInternal);
+    if (luser != user) {
+      FREE_C_HEAP_ARRAY(char, luser, mtInternal);
+    }
     THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
               "Process not found");
   }