1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a memory allocation problem in os_test.c (CVS 1782)

FossilOrigin-Name: ed511c2ea9581933ca504ce4b43d863503c6cc22
This commit is contained in:
danielk1977
2004-06-30 12:42:59 +00:00
parent 13073931a3
commit 5b59af85c7
4 changed files with 14 additions and 9 deletions

View File

@@ -159,6 +159,7 @@ static int cacheBlock(OsTestFile *pFile, int blk){
int n = ((pFile->nBlk * 2) + 100 + blk);
pFile->apBlk = (u8 **)sqliteRealloc(pFile->apBlk, n * sizeof(u8*));
if( !pFile->apBlk ) return SQLITE_NOMEM;
memset(&pFile->apBlk[pFile->nBlk], 0, (n - pFile->nBlk)*sizeof(u8*));
pFile->nBlk = n;
}