From a5c0ecb0e0ddd2c83daf54b0f3e7f0af92f580ef Mon Sep 17 00:00:00 2001 From: zyyang Date: Sat, 15 Jan 2022 20:01:35 +0800 Subject: [PATCH] [TS-1105](other): fix core dump when setLocale on windows --- src/client/src/tscSystem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 90f0468150..d5369e38f0 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -387,6 +387,10 @@ static int taos_options_imp(TSDB_OPTION option, const char *pStr) { cfg->cfgStatus = TAOS_CFG_CSTATUS_OPTION; } else { // set the user specified locale failed, use default LC_CTYPE as current locale locale = setlocale(LC_CTYPE, tsLocale); + if (locale == NULL) { + tscError("failed to set locale:%s failed, neither default LC_CTYPE: %s", pStr, tsLocale); + return -1; + } tscInfo("failed to set locale:%s, current locale:%s", pStr, tsLocale); } -- GitLab