fix(wal): use after free
This commit is contained in:
parent
b74560537c
commit
5d20804e76
|
@ -126,10 +126,11 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
SWalCkHead* lastEntry = (SWalCkHead*)found;
|
SWalCkHead* lastEntry = (SWalCkHead*)found;
|
||||||
|
int64_t retVer = lastEntry->head.version;
|
||||||
taosCloseFile(&pFile);
|
taosCloseFile(&pFile);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
|
|
||||||
return lastEntry->head.version;
|
return retVer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int walCheckAndRepairMeta(SWal* pWal) {
|
int walCheckAndRepairMeta(SWal* pWal) {
|
||||||
|
|
Loading…
Reference in New Issue