Merge pull request #14236 from taosdata/feature/TD-16524
fix:memory error
This commit is contained in:
commit
0e8319f70a
|
@ -388,7 +388,7 @@ int metaTtlDropTable(SMeta *pMeta, int64_t ttl, SArray *tbUids) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME){
|
static void metaBuildTtlIdxKey(STtlIdxKey *ttlKey, const SMetaEntry *pME){
|
||||||
int32_t ttlDays;
|
int64_t ttlDays;
|
||||||
int64_t ctime;
|
int64_t ctime;
|
||||||
if (pME->type == TSDB_CHILD_TABLE) {
|
if (pME->type == TSDB_CHILD_TABLE) {
|
||||||
ctime = pME->ctbEntry.ctime;
|
ctime = pME->ctbEntry.ctime;
|
||||||
|
|
|
@ -5023,6 +5023,7 @@ typedef struct SVgroupCreateTableBatch {
|
||||||
|
|
||||||
static void destroyCreateTbReq(SVCreateTbReq* pReq) {
|
static void destroyCreateTbReq(SVCreateTbReq* pReq) {
|
||||||
taosMemoryFreeClear(pReq->name);
|
taosMemoryFreeClear(pReq->name);
|
||||||
|
taosMemoryFreeClear(pReq->comment);
|
||||||
taosMemoryFreeClear(pReq->ntb.schemaRow.pSchema);
|
taosMemoryFreeClear(pReq->ntb.schemaRow.pSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5040,6 +5041,7 @@ static int32_t buildNormalTableBatchReq(int32_t acctId, const SCreateTableStmt*
|
||||||
if (pStmt->pOptions->commentNull == false) {
|
if (pStmt->pOptions->commentNull == false) {
|
||||||
req.comment = strdup(pStmt->pOptions->comment);
|
req.comment = strdup(pStmt->pOptions->comment);
|
||||||
if (NULL == req.comment) {
|
if (NULL == req.comment) {
|
||||||
|
destroyCreateTbReq(&req);
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
req.commentLen = strlen(pStmt->pOptions->comment);
|
req.commentLen = strlen(pStmt->pOptions->comment);
|
||||||
|
@ -5111,6 +5113,7 @@ static void destroyCreateTbReqBatch(SVgroupCreateTableBatch* pTbBatch) {
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
SVCreateTbReq* pTableReq = taosArrayGet(pTbBatch->req.pArray, i);
|
SVCreateTbReq* pTableReq = taosArrayGet(pTbBatch->req.pArray, i);
|
||||||
taosMemoryFreeClear(pTableReq->name);
|
taosMemoryFreeClear(pTableReq->name);
|
||||||
|
taosMemoryFreeClear(pTableReq->comment);
|
||||||
|
|
||||||
if (pTableReq->type == TSDB_NORMAL_TABLE) {
|
if (pTableReq->type == TSDB_NORMAL_TABLE) {
|
||||||
taosMemoryFreeClear(pTableReq->ntb.schemaRow.pSchema);
|
taosMemoryFreeClear(pTableReq->ntb.schemaRow.pSchema);
|
||||||
|
|
|
@ -468,7 +468,7 @@ double getVectorDoubleValue_JSON(void *src, int32_t index){
|
||||||
}
|
}
|
||||||
|
|
||||||
void* ncharTobinary(void *buf){ // todo need to remove , if tobinary is nchar
|
void* ncharTobinary(void *buf){ // todo need to remove , if tobinary is nchar
|
||||||
int32_t inputLen = varDataLen(buf);
|
int32_t inputLen = varDataTLen(buf);
|
||||||
|
|
||||||
void* t = taosMemoryCalloc(1, inputLen);
|
void* t = taosMemoryCalloc(1, inputLen);
|
||||||
int32_t len = taosUcs4ToMbs((TdUcs4 *)varDataVal(buf), varDataLen(buf), varDataVal(t));
|
int32_t len = taosUcs4ToMbs((TdUcs4 *)varDataVal(buf), varDataLen(buf), varDataVal(t));
|
||||||
|
|
Loading…
Reference in New Issue