aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2007-03-06 16:03:55 +0000
committerdanielk1977 <danielk1977@noemail.net>2007-03-06 16:03:55 +0000
commit884c5b32c98a9cae0d1976fc99c0058bf5a5ed8e (patch)
tree6e2ff93dfd0e0e31dbe2989802bb80c9da1e5a6f /src
parent7236583ba08dd523850f0a77dc906a006c5bbb15 (diff)
downloadsqlite-884c5b32c98a9cae0d1976fc99c0058bf5a5ed8e.tar.gz
sqlite-884c5b32c98a9cae0d1976fc99c0058bf5a5ed8e.zip
Catch an out-of-memory condition in vacuum code. (Bug in (3373)). (CVS 3675)
FossilOrigin-Name: 302ec768579e2f7c17a33749e685289a041aeb11
Diffstat (limited to 'src')
-rw-r--r--src/vacuum.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vacuum.c b/src/vacuum.c
index 77d99461e..7d04f8f93 100644
--- a/src/vacuum.c
+++ b/src/vacuum.c
@@ -14,7 +14,7 @@
** Most of the code in this file may be omitted by defining the
** SQLITE_OMIT_VACUUM macro.
**
-** $Id: vacuum.c,v 1.66 2007/01/03 23:37:29 drh Exp $
+** $Id: vacuum.c,v 1.67 2007/03/06 16:03:56 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -120,6 +120,10 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
pTemp = db->aDb[db->nDb-1].pBt;
sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain),
sqlite3BtreeGetReserve(pMain));
+ if( sqlite3MallocFailed() ){
+ rc = SQLITE_NOMEM;
+ goto end_of_vacuum;
+ }
assert( sqlite3BtreeGetPageSize(pTemp)==sqlite3BtreeGetPageSize(pMain) );
rc = execSql(db, "PRAGMA vacuum_db.synchronous=OFF");
if( rc!=SQLITE_OK ){