fix:[TD-26671] judge if pointer is null to avoid core dump

This commit is contained in:
wangmm0220 2023-10-11 11:08:14 +08:00
parent 19806cbcab
commit f7d1e0ea82
2 changed files with 4 additions and 0 deletions

View File

@ -268,6 +268,8 @@ STqReader* tqReaderOpen(SVnode* pVnode) {
}
void tqReaderClose(STqReader* pReader) {
if (pReader == NULL) return;
// close wal reader
if (pReader->pWalReader) {
walCloseReader(pReader->pWalReader);

View File

@ -56,6 +56,8 @@ SWalReader *walOpenReader(SWal *pWal, SWalFilterCond *cond, int64_t id) {
}
void walCloseReader(SWalReader *pReader) {
if(pReader == NULL) return NULL;
taosCloseFile(&pReader->pIdxFile);
taosCloseFile(&pReader->pLogFile);
taosMemoryFreeClear(pReader->pHead);