changeset 12622:e40abeb715f0

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 4de2898b79ff
children bd9629077386
files src/java.base/unix/native/libjava/TimeZone_md.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libjava/TimeZone_md.c	Tue Aug 25 20:21:53 2015 +0530
+++ b/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