1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a memory leak when the auxiliary data of a database structure is used. (CVS 1874)

FossilOrigin-Name: 7ecff04a6153aa200233e6c0846a65e0213c3179
This commit is contained in:
drh
2004-08-01 03:52:17 +00:00
parent feac5f8dbc
commit db2d9a0bbb
5 changed files with 15 additions and 27 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
** $Id: attach.c,v 1.25 2004/07/22 15:02:25 drh Exp $
** $Id: attach.c,v 1.26 2004/08/01 03:52:18 drh Exp $
*/
#include "sqliteInt.h"
@@ -189,14 +189,7 @@ void sqlite3Detach(Parse *pParse, Token *pDbname){
#endif /* SQLITE_OMIT_AUTHORIZATION */
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
sqliteFree(pDb->zName);
sqlite3ResetInternalSchema(db, i);
db->nDb--;
if( i<db->nDb ){
db->aDb[i] = db->aDb[db->nDb];
memset(&db->aDb[db->nDb], 0, sizeof(db->aDb[0]));
sqlite3ResetInternalSchema(db, i);
}
sqlite3ResetInternalSchema(db, 0);
}
/*