7017193: Small memory leak in get_stack_bounds os::create_stack_guard_pages

Getline() returns -1 but still allocate memory for str

Reviewed-by: dcubed, coleenp
This commit is contained in:
Dmitry Samersoff 2011-03-30 19:38:07 +04:00
parent 66a08540c2
commit 52bf12aead
3 changed files with 70 additions and 34 deletions

View file

@ -658,6 +658,10 @@ class os: AllStatic {
// Hook for os specific jvm options that we don't want to abort on seeing
static bool obsolete_option(const JavaVMOption *option);
// Read file line by line. If line is longer than bsize,
// rest of line is skipped. Returns number of bytes read or -1 on EOF
static int get_line_chars(int fd, char *buf, const size_t bsize);
// Platform dependent stuff
#ifdef TARGET_OS_FAMILY_linux
# include "os_linux.hpp"