diff --git a/jdk/src/java.base/unix/native/libjava/TimeZone_md.c b/jdk/src/java.base/unix/native/libjava/TimeZone_md.c index 849347015c6..455e2560874 100644 --- a/jdk/src/java.base/unix/native/libjava/TimeZone_md.c +++ b/jdk/src/java.base/unix/native/libjava/TimeZone_md.c @@ -685,6 +685,9 @@ findJavaTZ_md(const char *java_home_dir) #ifdef __solaris__ if (tz != NULL && strcmp(tz, "localtime") == 0) { tz = getSolarisDefaultZoneID(); + if (freetz != NULL) { + free((void *) freetz); + } freetz = tz; } #endif