diff options
author | drh <drh@noemail.net> | 2010-07-26 11:07:20 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-07-26 11:07:20 +0000 |
commit | 174b9a166d293445dcc3075c292b78115b62be8f (patch) | |
tree | 1a5d8aeb2c14be45b0e4656208b0aec5815d5acf /src/func.c | |
parent | d46def77db74a7dfadabb16da57c25d83af0c248 (diff) | |
parent | b975598ea0b3dbb1145513b0adada002c3c581bb (diff) | |
download | sqlite-174b9a166d293445dcc3075c292b78115b62be8f.tar.gz sqlite-174b9a166d293445dcc3075c292b78115b62be8f.zip |
Make sure all memory from sqlite3DbMalloc() is freed by sqlite3DbFree()
and all memory from sqlite3_malloc() is freed by sqlite3_free().
FossilOrigin-Name: 629e38a8c9e31111e351fe4625a5835576d23584
Diffstat (limited to 'src/func.c')
-rw-r--r-- | src/func.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/func.c b/src/func.c index 8b1b2f71f..15d7a5bd6 100644 --- a/src/func.c +++ b/src/func.c @@ -1010,14 +1010,14 @@ static void replaceFunc( testcase( nOut-2==db->aLimit[SQLITE_LIMIT_LENGTH] ); if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ sqlite3_result_error_toobig(context); - sqlite3DbFree(db, zOut); + sqlite3_free(zOut); return; } zOld = zOut; zOut = sqlite3_realloc(zOut, (int)nOut); if( zOut==0 ){ sqlite3_result_error_nomem(context); - sqlite3DbFree(db, zOld); + sqlite3_free(zOld); return; } memcpy(&zOut[j], zRep, nRep); @@ -1378,7 +1378,7 @@ static void groupConcatStep( if( pAccum ){ sqlite3 *db = sqlite3_context_db_handle(context); int firstTerm = pAccum->useMalloc==0; - pAccum->useMalloc = 1; + pAccum->useMalloc = 2; pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH]; if( !firstTerm ){ if( argc==2 ){ |