6936168: Recent fix for unmapping stack guard pages doesn't close /proc/self/maps
authorcoleenp
Thu, 18 Mar 2010 16:47:37 -0400
changeset 5090 fd9498f26582
parent 5089 0cce506a0158
child 5092 1866882fc8e2
6936168: Recent fix for unmapping stack guard pages doesn't close /proc/self/maps Summary: Add close to returns (fix for 6929067 also contributed by aph) Reviewed-by: aph, dcubed, andrew, acorn Contributed-by: aph@redhat.com, andreas.kohn@fredhopper.com
hotspot/src/os/linux/vm/os_linux.cpp
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Wed Mar 17 11:01:05 2010 +0100
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Thu Mar 18 16:47:37 2010 -0400
@@ -2528,6 +2528,7 @@
     char *str = NULL;
     ssize_t len = getline(&str, &dummy, f);
     if (len == -1) {
+      fclose(f);
       return false;
     }
 
@@ -2543,14 +2544,14 @@
         uintptr_t sp = (uintptr_t)__builtin_frame_address(0);
         if (sp >= *bottom && sp <= *top) {
           free(str);
+          fclose(f);
           return true;
         }
       }
     }
-
     free(str);
   }
-
+  fclose(f);
   return false;
 }