diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index d31d24d5552..e1cd8ce1852 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -985,12 +985,14 @@ uprv_tzname(int n) U_CAPI void U_EXPORT2 uprv_free_tzname(void) { +#ifdef SEARCH_TZFILE /* Only care if memory allocation due to searching for system timezone file. */ if (defaultTZstatus == TRUE) { uprv_free(gTimeZoneBufferPtr); gTimeZoneBufferPtr = NULL; defaultTZstatus = FALSE; } +#endif }