diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 6 | ||||
-rw-r--r-- | src/insert.c | 8 | ||||
-rw-r--r-- | src/vdbeaux.c | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/expr.c b/src/expr.c index a17085cc4..3002ef7b1 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.365 2008/04/01 18:04:11 drh Exp $ +** $Id: expr.c,v 1.366 2008/04/11 15:36:03 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -266,7 +266,8 @@ Expr *sqlite3Expr( const Token *pToken /* Argument token */ ){ Expr *pNew; - pNew = sqlite3DbMallocZero(db, sizeof(Expr)); + static const Expr zeroExpr; + pNew = sqlite3DbMallocRaw(db, sizeof(Expr)); if( pNew==0 ){ /* When malloc fails, delete pLeft and pRight. Expressions passed to ** this function must always be allocated with sqlite3Expr() for this @@ -276,6 +277,7 @@ Expr *sqlite3Expr( sqlite3ExprDelete(pRight); return 0; } + *pNew = zeroExpr; pNew->op = op; pNew->pLeft = pLeft; pNew->pRight = pRight; diff --git a/src/insert.c b/src/insert.c index 3188def0b..e090e1f76 100644 --- a/src/insert.c +++ b/src/insert.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.235 2008/04/01 05:07:15 drh Exp $ +** $Id: insert.c,v 1.236 2008/04/11 15:36:03 drh Exp $ */ #include "sqliteInt.h" @@ -45,7 +45,7 @@ void sqlite3IndexAffinityStr(Vdbe *v, Index *pIdx){ int n; Table *pTab = pIdx->pTable; sqlite3 *db = sqlite3VdbeDb(v); - pIdx->zColAff = (char *)sqlite3DbMallocZero(db, pIdx->nColumn+2); + pIdx->zColAff = (char *)sqlite3DbMallocRaw(db, pIdx->nColumn+2); if( !pIdx->zColAff ){ return; } @@ -86,7 +86,7 @@ void sqlite3TableAffinityStr(Vdbe *v, Table *pTab){ int i; sqlite3 *db = sqlite3VdbeDb(v); - zColAff = (char *)sqlite3DbMallocZero(db, pTab->nCol+1); + zColAff = (char *)sqlite3DbMallocRaw(db, pTab->nCol+1); if( !zColAff ){ return; } @@ -646,7 +646,7 @@ void sqlite3Insert( baseCur = pParse->nTab; nIdx = sqlite3OpenTableAndIndices(pParse, pTab, baseCur, OP_OpenWrite); - aRegIdx = sqlite3DbMallocZero(db, sizeof(int)*(nIdx+1)); + aRegIdx = sqlite3DbMallocRaw(db, sizeof(int)*(nIdx+1)); if( aRegIdx==0 ){ goto insert_cleanup; } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 861797fd5..af77c8df4 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -108,7 +108,6 @@ void sqlite3VdbeTrace(Vdbe *p, FILE *trace){ */ static void resizeOpArray(Vdbe *p, int N){ VdbeOp *pNew; - int oldSize = p->nOpAlloc; pNew = sqlite3DbRealloc(p->db, p->aOp, N*sizeof(Op)); if( pNew ){ p->nOpAlloc = N; @@ -1089,7 +1088,7 @@ void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){ if( !pCx->ephemPseudoTable ){ sqlite3_free(pCx->pData); } - memset(pCx, 0, sizeof(Cursor)); + /* memset(pCx, 0, sizeof(Cursor)); */ /* sqlite3_free(pCx->aType); */ /* sqlite3_free(pCx); */ } |