From b8671afff81d2054f13f87f89d989103a79c2560 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 16 Nov 2021 23:26:56 +0800 Subject: [PATCH] fix windows compilation error --- src/client/src/tscSQLParser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index af4cd08edb..cf2e216fef 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6071,13 +6071,13 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { bool dbIncluded = false; SStrToken tmpToken = pAlterSQL->name; - const int32_t bufLen = pAlterSQL->name.n; - char tmpTokenBuf[bufLen]; + char *tmpTokenBuf = strndup(pAlterSQL->name.z, pAlterSQL->name.n); tmpToken.z = tmpTokenBuf; - memcpy(tmpTokenBuf, pAlterSQL->name.z, pAlterSQL->name.n); if (tscValidateName(&tmpToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) { + free(tmpTokenBuf); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); } + free(tmpTokenBuf); code = tscSetTableFullName(&pTableMetaInfo->name, &tmpToken, pSql, dbIncluded); if (code != TSDB_CODE_SUCCESS) { -- GitLab