1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a memory leak that occurred when sqlite_open() failed. (CVS 745)

FossilOrigin-Name: a876021304a5de7ede1bf835971da7e328d1af07
This commit is contained in:
drh
2002-09-05 23:21:37 +00:00
parent 96ddd6db58
commit 8c90ebb0e2
3 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.101 2002/09/03 19:43:24 drh Exp $
** $Id: main.c,v 1.102 2002/09/05 23:21:37 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -355,7 +355,6 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
sqliteHashInit(&db->trigHash, SQLITE_HASH_STRING, 0);
sqliteHashInit(&db->aFunc, SQLITE_HASH_STRING, 1);
sqliteHashInit(&db->aFKey, SQLITE_HASH_STRING, 1);
sqliteRegisterBuiltinFunctions(db);
db->onError = OE_Default;
db->priorNewRowid = 0;
db->magic = SQLITE_MAGIC_BUSY;
@@ -374,6 +373,7 @@ sqlite *sqlite_open(const char *zFilename, int mode, char **pzErrMsg){
}
/* Attempt to read the schema */
sqliteRegisterBuiltinFunctions(db);
rc = sqliteInit(db, pzErrMsg);
db->magic = SQLITE_MAGIC_OPEN;
if( sqlite_malloc_failed ){