1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Report any error which occurs in closing the database at exit. Free a

couple of strings which were leaking. (CVS 3340)

FossilOrigin-Name: 47353f62ca7635b693718997e792358d16bd117b
This commit is contained in:
adamd
2006-07-28 20:16:14 +00:00
parent 20b1eaffd8
commit 0a3daa3086
3 changed files with 16 additions and 10 deletions

View File

@@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases.
**
** $Id: shell.c,v 1.144 2006/06/27 20:39:04 drh Exp $
** $Id: shell.c,v 1.145 2006/07/28 20:16:14 adamd Exp $
*/
#include <stdlib.h>
#include <string.h>
@@ -1814,12 +1814,18 @@ int main(int argc, char **argv){
if( zHistory ){
stifle_history(100);
write_history(zHistory);
free(zHistory);
}
free(zHome);
}else{
process_input(&data, stdin);
}
}
set_table_name(&data, 0);
if( db ) sqlite3_close(db);
if( db ){
if( sqlite3_close(db)!=SQLITE_OK ){
fprintf(stderr,"error closing database: %s\n", sqlite3_errmsg(db));
}
}
return 0;
}