aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-05-19 23:55:30 +0000
committerdrh <drh@noemail.net>2003-05-19 23:55:30 +0000
commit6e1d288a9f50f7b715b37c8ec96713f35b7fb39e (patch)
tree82c66deb871906df7f4ca6cf72257c8a1a5f8cfd /src
parent6b8611126b49ce0b69261c7636d80360bef4603d (diff)
downloadsqlite-6e1d288a9f50f7b715b37c8ec96713f35b7fb39e.tar.gz
sqlite-6e1d288a9f50f7b715b37c8ec96713f35b7fb39e.zip
Fix segfault that occurs when opening a non-existing database in the shell
then immediately doing ".q". (CVS 986) FossilOrigin-Name: e8566cf5a381fa7655caacbc0fe95091e1137fea
Diffstat (limited to 'src')
-rw-r--r--src/shell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shell.c b/src/shell.c
index 48e367c27..bd9a85080 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -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