mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Follow-up to check-in (3164). Make sure SQLITE_NOMEM is returned after
a memory allocation failure. It is not sufficent to return an "out of memory" error message. The return code needs to be SQLITE_NOMEM. (CVS 3172) FossilOrigin-Name: 9d95750e8556aef20a637a815652d547ed2f887c
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to implement the ATTACH and DETACH commands.
|
||||
**
|
||||
** $Id: attach.c,v 1.50 2006/04/05 11:57:37 drh Exp $
|
||||
** $Id: attach.c,v 1.51 2006/04/10 13:37:47 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -186,7 +186,7 @@ static void attachFunc(
|
||||
sqlite3ResetInternalSchema(db, 0);
|
||||
db->nDb = iDb;
|
||||
if( rc==SQLITE_NOMEM ){
|
||||
sqlite3MallocFailed();
|
||||
if( !sqlite3MallocFailed() ) sqlite3FailedMalloc();
|
||||
sqlite3_snprintf(127, zErr, "out of memory");
|
||||
}else{
|
||||
sqlite3_snprintf(127, zErr, "unable to open database: %s", zFile);
|
||||
|
||||
Reference in New Issue
Block a user