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
--- 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