diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-03-25 09:56:44 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-03-25 09:56:44 +0000 |
commit | 6507ecb3763f25b76fae1f2911f5965e201b4912 (patch) | |
tree | d8799f8d895d9b0475155688678dc6862ee343bd /src | |
parent | cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab (diff) | |
download | sqlite-6507ecb3763f25b76fae1f2911f5965e201b4912.tar.gz sqlite-6507ecb3763f25b76fae1f2911f5965e201b4912.zip |
Fix for memory leak in malloc3.test. (CVS 4913)
FossilOrigin-Name: ef0e40e814b3d3a00721f8ca39bac0db1be24347
Diffstat (limited to 'src')
-rw-r--r-- | src/btree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/btree.c b/src/btree.c index 869e4e937..835396301 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.444 2008/03/25 09:47:35 danielk1977 Exp $ +** $Id: btree.c,v 1.445 2008/03/25 09:56:45 danielk1977 Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** See the header comment on "btreeInt.h" for additional information. @@ -3644,7 +3644,10 @@ int sqlite3BtreeMoveto( c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey); }else{ pCellKey = sqlite3_malloc( nCellKey ); - if( pCellKey==0 ) return SQLITE_NOMEM; + if( pCellKey==0 ){ + rc = SQLITE_NOMEM; + goto moveto_finish; + } rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey); c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey); sqlite3_free(pCellKey); |