[td-1373] fix invalid write and memory leaks
This commit is contained in:
parent
6b49d26693
commit
6532bced2b
|
@ -698,7 +698,8 @@ int32_t tscLocalReducerEnvCreate(SSqlObj *pSql, tExtMemBuffer ***pMemBuffer, tOr
|
||||||
pg *= 2;
|
pg *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t numOfSubs = pTableMetaInfo->vgroupList->numOfVgroups;
|
size_t numOfSubs = pSql->subState.numOfSub;
|
||||||
|
assert(numOfSubs <= pTableMetaInfo->vgroupList->numOfVgroups);
|
||||||
for (int32_t i = 0; i < numOfSubs; ++i) {
|
for (int32_t i = 0; i < numOfSubs; ++i) {
|
||||||
(*pMemBuffer)[i] = createExtMemBuffer(nBufferSizes, rlen, pg, pModel);
|
(*pMemBuffer)[i] = createExtMemBuffer(nBufferSizes, rlen, pg, pModel);
|
||||||
(*pMemBuffer)[i]->flushModel = MULTIPLE_APPEND_MODEL;
|
(*pMemBuffer)[i]->flushModel = MULTIPLE_APPEND_MODEL;
|
||||||
|
|
|
@ -3877,6 +3877,7 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
|
||||||
|
|
||||||
if (pTableQueryInfo->cur.vgroupIndex == -1) {
|
if (pTableQueryInfo->cur.vgroupIndex == -1) {
|
||||||
tVariantAssign(&pTableQueryInfo->tag, pTag);
|
tVariantAssign(&pTableQueryInfo->tag, pTag);
|
||||||
|
|
||||||
STSElem elem = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pTableQueryInfo->tag);
|
STSElem elem = tsBufGetElemStartPos(pRuntimeEnv->pTSBuf, pQInfo->vgId, &pTableQueryInfo->tag);
|
||||||
|
|
||||||
// failed to find data with the specified tag value and vnodeId
|
// failed to find data with the specified tag value and vnodeId
|
||||||
|
@ -3887,6 +3888,7 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
|
||||||
qError("QInfo:%p failed to find tag:%" PRId64 " in ts_comp", pQInfo, pTag->i64Key);
|
qError("QInfo:%p failed to find tag:%" PRId64 " in ts_comp", pQInfo, pTag->i64Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tVariantDestroy(&elem.tag);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue