fix(tsdb): add null ptr check.

This commit is contained in:
Haojun Liao 2023-06-24 00:41:05 +08:00
parent 4ce1614045
commit 4a7698d4ab
2 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,10 @@ void *destroyLastBlockLoadInfo(SSttBlockLoadInfo *pLoadInfo) {
}
void destroySttBlockReader(SLDataIter* pLDataIter, int32_t numOfIter) {
if (pLDataIter == NULL) {
return;
}
for(int32_t i = 0; i < numOfIter; ++i) {
tLDataIterClose2(&pLDataIter[i]);
}

View File

@ -4791,6 +4791,7 @@ static void clearSharedPtr(STsdbReader* p) {
p->pReadSnap = NULL;
p->pSchema = NULL;
p->pSchemaMap = NULL;
p->pfSetArray = NULL;
}
static void setSharedPtr(STsdbReader* pDst, const STsdbReader* pSrc) {
@ -4800,6 +4801,7 @@ static void setSharedPtr(STsdbReader* pDst, const STsdbReader* pSrc) {
pDst->pSchema = pSrc->pSchema;
pDst->pSchemaMap = pSrc->pSchemaMap;
pDst->pReadSnap = pSrc->pReadSnap;
pDst->pfSetArray = pSrc->pfSetArray;
if (pDst->pSchema) {
tsdbRowMergerInit(&pDst->status.merger, pDst->pSchema);