fix: memory leak
This commit is contained in:
parent
f4f08b24d2
commit
ca26f55032
|
@ -1153,6 +1153,16 @@ static int32_t parseValueToken(SInsertParseContext* pCxt, const char** pSql, STo
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void clearColValArray(SArray* pCols) {
|
||||||
|
int32_t num = taosArrayGetSize(pCols);
|
||||||
|
for (int32_t i = 0; i < num; ++i) {
|
||||||
|
SColVal* pCol = taosArrayGet(pCols, i);
|
||||||
|
if (TSDB_DATA_TYPE_NCHAR == pCol->type) {
|
||||||
|
taosMemoryFreeClear(pCol->value.pData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataCxt* pTableCxt, bool* pGotRow,
|
static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataCxt* pTableCxt, bool* pGotRow,
|
||||||
SToken* pToken) {
|
SToken* pToken) {
|
||||||
SBoundColInfo* pCols = &pTableCxt->boundColsInfo;
|
SBoundColInfo* pCols = &pTableCxt->boundColsInfo;
|
||||||
|
@ -1206,6 +1216,8 @@ static int parseOneRow(SInsertParseContext* pCxt, const char** pSql, STableDataC
|
||||||
*pGotRow = true;
|
*pGotRow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearColValArray(pTableCxt->pValues);
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue