]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix segfault that occurs when opening a non-existing database in the shell
authordrh <drh@noemail.net>
Mon, 19 May 2003 23:55:30 +0000 (23:55 +0000)
committerdrh <drh@noemail.net>
Mon, 19 May 2003 23:55:30 +0000 (23:55 +0000)
then immediately doing ".q". (CVS 986)

FossilOrigin-Name: e8566cf5a381fa7655caacbc0fe95091e1137fea

manifest
manifest.uuid
src/shell.c

index 5531040e0602a7bc5d712da0821854b661b61f24..baf6b46a2c97f0c7c15e371939d3c1eebaac1d46 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Additional\sattach\stesting.\s\sI\snow\sbelieve\sthat\sticket\s#317\swas\sfixed\nby\scheck-in\s(981).\s(CVS\s985)
-D 2003-05-17T19:23:52
+C Fix\ssegfault\sthat\soccurs\swhen\sopening\sa\snon-existing\sdatabase\sin\sthe\sshell\nthen\simmediately\sdoing\s".q".\s(CVS\s986)
+D 2003-05-19T23:55:30
 F Makefile.in 1ff85c27d4350c74118341024e8a4fb2a04a3a43
 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -44,7 +44,7 @@ F src/pragma.c ec64704e61286948f39157617f1ce2f506dd1b74
 F src/printf.c fc5fdef6e92ad205005263661fe9716f55a49f3e
 F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
 F src/select.c 15d921308065c9320363af6f43c01d9f09ea7118
-F src/shell.c 2565cb32cd862024bcfd88400e05437636cf21a1
+F src/shell.c b63089a91d6584df06eaa2e53ea1150c68ab1e61
 F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
 F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e
 F src/sqliteInt.h 3ba355793a1e0b891cfa414901759189c9287a18
@@ -165,7 +165,7 @@ F www/speed.tcl cb4c10a722614aea76d2c51f32ee43400d5951be
 F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125
 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P c8c823b068916711857fa67db10fb479999b55c2
-R bc3167929b77207fc599db40b8510a4e
+P 24191373796b7fd6255ef9b70ce2344326308113
+R 0ad195f6ccdfb80921d558f2c3b71dfc
 U drh
-Z 07eb60187b21aabbdcf71968529d48bd
+Z 12c0806bd04cf1493cea64fc795aa255
index eeadd48e75c1e896662b13e9bc777208dee9a0e0..4c7e2fd6f12af54ccf92bd785fb09b8f11ee08f6 100644 (file)
@@ -1 +1 @@
-24191373796b7fd6255ef9b70ce2344326308113
\ No newline at end of file
+e8566cf5a381fa7655caacbc0fe95091e1137fea
\ No newline at end of file
index 48e367c27045196af40afdba89cf743d9058af54..bd9a85080fb907ec7e8dbfb9e9f2982041785a04 100644 (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