diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index cf2e216fefcdc46199622edae86d707df0e9e1bc..b33faa7d4f04481ea97d86636da34f5ea4e37e9c 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6071,18 +6071,18 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { bool dbIncluded = false; SStrToken tmpToken = pAlterSQL->name; - char *tmpTokenBuf = strndup(pAlterSQL->name.z, pAlterSQL->name.n); - tmpToken.z = tmpTokenBuf; + tmpToken.z= strndup(pAlterSQL->name.z, pAlterSQL->name.n); if (tscValidateName(&tmpToken, true, &dbIncluded) != TSDB_CODE_SUCCESS) { - free(tmpTokenBuf); + free(tmpToken.z); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); } - free(tmpTokenBuf); code = tscSetTableFullName(&pTableMetaInfo->name, &tmpToken, pSql, dbIncluded); if (code != TSDB_CODE_SUCCESS) { + free(tmpToken.z); return code; } + free(tmpToken.z); code = tscGetTableMeta(pSql, pTableMetaInfo); if (code != TSDB_CODE_SUCCESS) {