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

Fix segfault that occurs when opening a non-existing database in the shell

then immediately doing ".q". (CVS 986)

FossilOrigin-Name: e8566cf5a381fa7655caacbc0fe95091e1137fea
This commit is contained in:
drh
2003-05-19 23:55:30 +00:00
parent 6b8611126b
commit 6e1d288a9f
3 changed files with 9 additions and 9 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.79 2003/05/13 00:24:41 drh Exp $
** $Id: shell.c,v 1.80 2003/05/19 23:55:30 drh Exp $
*/
#include <stdlib.h>
#include <string.h>
@@ -767,7 +767,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
}else
if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){
sqlite_close(p->db);
if( p->db ) sqlite_close(p->db);
exit(0);
}else