diff --git a/source/libs/wal/src/walMeta.c b/source/libs/wal/src/walMeta.c index 4bb6f07a47..a5fd3fca35 100644 --- a/source/libs/wal/src/walMeta.c +++ b/source/libs/wal/src/walMeta.c @@ -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) {