mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix an inconsequential memory leak in sqldiff. Update the "Sanitize" case in wapptest.tcl to use -fsanitize=address,undefined, and to run more tests.
FossilOrigin-Name: 613fb5c2525be77e48bad0a74e8b7bf53489365060fb9c7713a0caddb1820c71
This commit is contained in:
@ -1544,6 +1544,7 @@ static void changeset_one_table(const char *zTab, FILE *out){
|
||||
|
||||
/* Check that the schemas of the two tables match. Exit early otherwise. */
|
||||
checkSchemasMatch(zTab);
|
||||
strInit(&sql);
|
||||
|
||||
pStmt = db_prepare("PRAGMA main.table_info=%Q", zTab);
|
||||
while( SQLITE_ROW==sqlite3_step(pStmt) ){
|
||||
@ -1565,7 +1566,6 @@ static void changeset_one_table(const char *zTab, FILE *out){
|
||||
}
|
||||
sqlite3_finalize(pStmt);
|
||||
if( nPk==0 ) goto end_changeset_one_table;
|
||||
strInit(&sql);
|
||||
if( nCol>nPk ){
|
||||
strPrintf(&sql, "SELECT %d", SQLITE_UPDATE);
|
||||
for(i=0; i<nCol; i++){
|
||||
@ -1707,6 +1707,8 @@ end_changeset_one_table:
|
||||
sqlite3_free(azCol);
|
||||
sqlite3_free(aiPk);
|
||||
sqlite3_free(zId);
|
||||
sqlite3_free(aiFlg);
|
||||
strFree(&sql);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1971,6 +1973,8 @@ int main(int argc, char **argv){
|
||||
#endif
|
||||
zSql = sqlite3_mprintf("ATTACH %Q as aux;", zDb2);
|
||||
rc = sqlite3_exec(g.db, zSql, 0, 0, &zErrMsg);
|
||||
sqlite3_free(zSql);
|
||||
zSql = 0;
|
||||
if( rc || zErrMsg ){
|
||||
cmdlineError("cannot attach database \"%s\"", zDb2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user