1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Fix a uninitialized variable use in the command-line shell when the

".open" command is invoked without any arguments.

FossilOrigin-Name: fc4f4d1eccec2e09b5d2e6c4da082204f4d5a016
This commit is contained in:
drh
2015-06-17 17:08:22 +00:00
parent b0870486aa
commit bbe031f9f1
3 changed files with 9 additions and 10 deletions

View File

@@ -3354,9 +3354,8 @@ static int do_meta_command(char *zLine, ShellState *p){
const char *zSavedFilename = p->zDbFilename;
char *zNewFilename = 0;
p->db = 0;
if( nArg>=2 ){
p->zDbFilename = zNewFilename = sqlite3_mprintf("%s", azArg[1]);
}
if( nArg>=2 ) zNewFilename = sqlite3_mprintf("%s", azArg[1]);
p->zDbFilename = zNewFilename;
open_db(p, 1);
if( p->db!=0 ){
sqlite3_close(savedDb);