diff options
author | drh <drh@noemail.net> | 2007-08-16 04:30:38 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-08-16 04:30:38 +0000 |
commit | 174357527a47e97f3d782c1327be6dfd48f7082f (patch) | |
tree | 846ccc36dd9fae23e6c33b52686b4f742ca7640d /src/vdbeblob.c | |
parent | 0e6f1546b05fd04fb3b3e963df948259683deee4 (diff) | |
download | sqlite-174357527a47e97f3d782c1327be6dfd48f7082f.tar.gz sqlite-174357527a47e97f3d782c1327be6dfd48f7082f.zip |
Half-way through a major refactoring of the memory allocation.
I have not even attempted to compile so I am certain there are
countless errors. (CVS 4231)
FossilOrigin-Name: deb7ecd65f7b83eaf0ba610eeef3b0ede61db1c3
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r-- | src/vdbeblob.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c index 8ec836f35..8fdf06380 100644 --- a/src/vdbeblob.c +++ b/src/vdbeblob.c @@ -12,7 +12,7 @@ ** ** This file contains code used to implement incremental BLOB I/O. ** -** $Id: vdbeblob.c,v 1.11 2007/06/27 00:36:14 drh Exp $ +** $Id: vdbeblob.c,v 1.12 2007/08/16 04:30:41 drh Exp $ */ #include "sqliteInt.h" @@ -104,7 +104,7 @@ int sqlite3_blob_open( if( sParse.zErrMsg ){ sqlite3_snprintf(sizeof(zErr), zErr, "%s", sParse.zErrMsg); } - sqliteFree(sParse.zErrMsg); + sqlite3_free(sParse.zErrMsg); rc = SQLITE_ERROR; sqlite3SafetyOff(db); goto blob_open_out; @@ -173,13 +173,13 @@ int sqlite3_blob_open( ** and offset cache without causing any IO. */ sqlite3VdbeChangeP2(v, 5, pTab->nCol+1); - if( !sqlite3MallocFailed() ){ + if( !db->mallocFailed ){ sqlite3VdbeMakeReady(v, 1, 0, 1, 0); } } rc = sqlite3SafetyOff(db); - if( rc!=SQLITE_OK || sqlite3MallocFailed() ){ + if( rc!=SQLITE_OK || db->mallocFailed ){ goto blob_open_out; } @@ -208,9 +208,9 @@ int sqlite3_blob_open( rc = SQLITE_ERROR; goto blob_open_out; } - pBlob = (Incrblob *)sqliteMalloc(sizeof(Incrblob)); - if( sqlite3MallocFailed() ){ - sqliteFree(pBlob); + pBlob = (Incrblob *)sqlite3DbMallocZero(db, sizeof(Incrblob)); + if( db->mallocFailed ){ + sqlite3_free(pBlob); goto blob_open_out; } pBlob->flags = flags; @@ -228,7 +228,7 @@ int sqlite3_blob_open( blob_open_out: zErr[sizeof(zErr)-1] = '\0'; - if( rc!=SQLITE_OK || sqlite3MallocFailed() ){ + if( rc!=SQLITE_OK || db->mallocFailed ){ sqlite3_finalize((sqlite3_stmt *)v); } sqlite3Error(db, rc, (rc==SQLITE_OK?0:zErr)); @@ -242,7 +242,7 @@ blob_open_out: int sqlite3_blob_close(sqlite3_blob *pBlob){ Incrblob *p = (Incrblob *)pBlob; sqlite3_stmt *pStmt = p->pStmt; - sqliteFree(p); + sqlite3_free(p); return sqlite3_finalize(pStmt); } |