This commit is contained in:
Hongze Cheng 2022-09-04 23:51:26 +08:00
parent 0480158500
commit 70b89becb9
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ static int32_t tsdbOpenFile(const char *path, int32_t szPage, int32_t flag, STsd
} }
pFD->szPage = szPage; pFD->szPage = szPage;
pFD->pgno = 0; pFD->pgno = 0;
pFD->pBuf = taosMemoryMalloc(szPage); pFD->pBuf = taosMemoryCalloc(1, szPage);
if (pFD->pBuf == NULL) { if (pFD->pBuf == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY; code = TSDB_CODE_OUT_OF_MEMORY;
taosMemoryFree(pFD); taosMemoryFree(pFD);
@ -84,7 +84,7 @@ static int32_t tsdbWriteFilePage(STsdbFD *pFD) {
} }
if (pFD->szFile < pFD->pgno) { if (pFD->szFile < pFD->pgno) {
pFD->szFile = pFD->szFile; pFD->szFile = pFD->pgno;
} }
} }
pFD->pgno = 0; pFD->pgno = 0;