changeset 2446:6d78b2dfa5dc

OPENJDK6-3: Fix memory leak in get_stack_bounds Summary: Memory is allocated by getline but not freed if it fails Reviewed-by: aph
author andrew
date Thu, 21 Mar 2013 13:26:12 +0000
parents 62993f16dce2
children f9d5be4340c0
files src/os/linux/vm/os_linux.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.cpp	Thu Mar 14 10:51:47 2013 -0400
+++ b/src/os/linux/vm/os_linux.cpp	Thu Mar 21 13:26:12 2013 +0000
@@ -2650,6 +2650,8 @@
     ssize_t len = getline(&str, &dummy, f);
     if (len == -1) {
       fclose(f);
+      if (str != NULL)
+	free(str);
       return false;
     }