1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix for memory leak in malloc3.test. (CVS 4913)

FossilOrigin-Name: ef0e40e814b3d3a00721f8ca39bac0db1be24347
This commit is contained in:
danielk1977
2008-03-25 09:56:44 +00:00
parent cd3e8f7ce9
commit 6507ecb376
3 changed files with 12 additions and 9 deletions

View File

@@ -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);