From 8b2acdb5a48f37a938f01305da656c54d062e969 Mon Sep 17 00:00:00 2001 From: coleenp Date: Thu, 18 Mar 2010 16:47:37 -0400 Subject: [PATCH] 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 --- src/os/linux/vm/os_linux.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp index 02399b287..dec664574 100644 --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -2528,6 +2528,7 @@ get_stack_bounds(uintptr_t *bottom, uintptr_t *top) char *str = NULL; ssize_t len = getline(&str, &dummy, f); if (len == -1) { + fclose(f); return false; } @@ -2543,14 +2544,14 @@ get_stack_bounds(uintptr_t *bottom, uintptr_t *top) 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; } -- GitLab