6936168: Recent fix for unmapping stack guard pages doesn't close /proc/self/maps

Add close to returns (fix for 6929067 also contributed by aph)

Co-authored-by: Andreas Kohn <andreas.kohn@fredhopper.com>
Reviewed-by: aph, dcubed, andrew, acorn
This commit is contained in:
Andrew Haley 2010-03-18 16:47:37 -04:00 committed by Coleen Phillimore
parent 2450ae35a1
commit 87f44737a8

View File

@ -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;
}