8133830: [solaris] Fix for potential memory leak in TimeZone_md.c, function findJavaTZ_md()
authoraefimov
Tue, 25 Aug 2015 18:40:32 +0300
changeset 32274 51ea96c8ae89
parent 32273 de3cc06aec56
child 32275 17eeb583a331
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
jdk/src/java.base/unix/native/libjava/TimeZone_md.c
--- 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