diff options
author | danielk1977 <danielk1977@noemail.net> | 2004-06-30 12:42:59 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2004-06-30 12:42:59 +0000 |
commit | 5b59af85c761b6806de49f98cce235da604fbd7c (patch) | |
tree | c79f0f6aa4c34280c8a3388da2b7bd6ebe427b15 /src | |
parent | 13073931a356b9214371f4ce79dcf8c551e6ece0 (diff) | |
download | sqlite-5b59af85c761b6806de49f98cce235da604fbd7c.tar.gz sqlite-5b59af85c761b6806de49f98cce235da604fbd7c.zip |
Fix a memory allocation problem in os_test.c (CVS 1782)
FossilOrigin-Name: ed511c2ea9581933ca504ce4b43d863503c6cc22
Diffstat (limited to 'src')
-rw-r--r-- | src/os_test.c | 1 | ||||
-rw-r--r-- | src/tclsqlite.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/os_test.c b/src/os_test.c index f9091202c..a69ba50e1 100644 --- a/src/os_test.c +++ b/src/os_test.c @@ -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; } diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 652f65f09..7e9b463a0 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -11,7 +11,7 @@ ************************************************************************* ** A TCL Interface to SQLite ** -** $Id: tclsqlite.c,v 1.94 2004/06/30 11:54:07 danielk1977 Exp $ +** $Id: tclsqlite.c,v 1.95 2004/06/30 12:42:59 danielk1977 Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ @@ -1081,10 +1081,14 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ #ifdef SQLITE_TEST { extern void Md5_Register(sqlite*); +#ifdef SQLITE_DEBUG int mallocfail = sqlite3_iMallocFail; sqlite3_iMallocFail = 0; +#endif Md5_Register(p->db); +#ifdef SQLITE_DEBUG sqlite3_iMallocFail = mallocfail; +#endif } #endif p->interp = interp; |