ICU-7135 fix a memory leak in timezone.cpp on Windows

X-SVN-Rev: 26616
This commit is contained in:
Jungshik Shin 2009-09-09 23:39:16 +00:00
parent df6548d8bf
commit 1dc8949de0

View file

@ -578,6 +578,11 @@ TimeZone::initDefault()
hostStrID.truncate(hostStrID.length()-1);
default_zone = createSystemTimeZone(hostStrID);
#ifdef U_WINDOWS
// hostID points to a heap-allocated location on Windows.
uprv_free(const_cast<char *>(hostID));
#endif
int32_t hostIDLen = hostStrID.length();
if (default_zone != NULL && rawOffset != default_zone->getRawOffset()
&& (3 <= hostIDLen && hostIDLen <= 4))