diff options
author | 2012-11-29 05:10:05 +0000 | |
---|---|---|
committer | 2012-11-29 05:10:05 +0000 | |
commit | be3f74ce3c902de43c5546856650ba8940de1806 (patch) | |
tree | 3531b5929e9c27036ab1dbd09f0514290aa1d803 /lib/libsqlite3/src/pcache1.c | |
parent | struct ktr_header changed back in April 2012, rearranging the members, (diff) | |
download | wireguard-openbsd-be3f74ce3c902de43c5546856650ba8940de1806.tar.xz wireguard-openbsd-be3f74ce3c902de43c5546856650ba8940de1806.zip |
minor update to 3.7.14.1
Diffstat (limited to 'lib/libsqlite3/src/pcache1.c')
-rw-r--r-- | lib/libsqlite3/src/pcache1.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libsqlite3/src/pcache1.c b/lib/libsqlite3/src/pcache1.c index c41b49e6c86..4147d2eff55 100644 --- a/lib/libsqlite3/src/pcache1.c +++ b/lib/libsqlite3/src/pcache1.c @@ -396,11 +396,10 @@ static int pcache1ResizeHash(PCache1 *p){ pcache1LeaveMutex(p->pGroup); if( p->nHash ){ sqlite3BeginBenignMalloc(); } - apNew = (PgHdr1 **)sqlite3_malloc(sizeof(PgHdr1 *)*nNew); + apNew = (PgHdr1 **)sqlite3MallocZero(sizeof(PgHdr1 *)*nNew); if( p->nHash ){ sqlite3EndBenignMalloc(); } pcache1EnterMutex(p->pGroup); if( apNew ){ - memset(apNew, 0, sizeof(PgHdr1 *)*nNew); for(i=0; i<p->nHash; i++){ PgHdr1 *pPage; PgHdr1 *pNext = p->apHash[i]; @@ -584,9 +583,8 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){ assert( szExtra < 300 ); sz = sizeof(PCache1) + sizeof(PGroup)*separateCache; - pCache = (PCache1 *)sqlite3_malloc(sz); + pCache = (PCache1 *)sqlite3MallocZero(sz); if( pCache ){ - memset(pCache, 0, sz); if( separateCache ){ pGroup = (PGroup*)&pCache[1]; pGroup->mxPinned = 10; |