changeset 32274:51ea96c8ae89

8133830: [solaris] Fix for potential memory leak in TimeZone_md.c, function findJavaTZ_md() Reviewed-by: andrew, goetz, okutsu Contributed-by: christoph.langer@sap.com
author aefimov
date Tue, 25 Aug 2015 18:40:32 +0300
parents de3cc06aec56
children 17eeb583a331
files jdk/src/java.base/unix/native/libjava/TimeZone_md.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/java.base/unix/native/libjava/TimeZone_md.c	Tue Aug 25 20:21:53 2015 +0530
+++ b/jdk/src/java.base/unix/native/libjava/TimeZone_md.c	Tue Aug 25 18:40:32 2015 +0300
@@ -685,6 +685,9 @@
 #ifdef __solaris__
     if (tz != NULL && strcmp(tz, "localtime") == 0) {
         tz = getSolarisDefaultZoneID();
+        if (freetz != NULL) {
+            free((void *) freetz);
+        }
         freetz = tz;
     }
 #endif