fix(wal): use after free

This commit is contained in:
Liu Jicong 2022-07-20 17:10:41 +08:00
parent b74560537c
commit 5d20804e76
1 changed files with 2 additions and 1 deletions

View File

@ -126,10 +126,11 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal) {
return -1;
}
SWalCkHead* lastEntry = (SWalCkHead*)found;
int64_t retVer = lastEntry->head.version;
taosCloseFile(&pFile);
taosMemoryFree(buf);
return lastEntry->head.version;
return retVer;
}
int walCheckAndRepairMeta(SWal* pWal) {