diff options
author | drh <drh@noemail.net> | 2018-10-11 10:37:24 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-10-11 10:37:24 +0000 |
commit | 1dbb1475985639849099ef8d2c9483a9dbb7da1c (patch) | |
tree | 8df1b81fb3a875e3927cccd6d1339eef4e76b0c5 /src | |
parent | b6c4d59e89f667838cf0d4500d36e3542253dc85 (diff) | |
download | sqlite-1dbb1475985639849099ef8d2c9483a9dbb7da1c.tar.gz sqlite-1dbb1475985639849099ef8d2c9483a9dbb7da1c.zip |
In the CLI, fix a file descriptor leak following OOM and a missing va_end()
call.
FossilOrigin-Name: ec36d15a9e349f4295a9e2215dea0a18e9276e0e4ce2d05021e6b467ab7763bb
Diffstat (limited to 'src')
-rw-r--r-- | src/shell.c.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shell.c.in b/src/shell.c.in index a5ab14383..c1db72ce5 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -3592,7 +3592,7 @@ static char *readFile(const char *zName, int *pnByte){ nIn = ftell(in); rewind(in); pBuf = sqlite3_malloc64( nIn+1 ); - if( pBuf==0 ) return 0; + if( pBuf==0 ){ fclose(in); return 0; } nRead = fread(pBuf, nIn, 1, in); fclose(in); if( nRead!=1 ){ @@ -4976,6 +4976,7 @@ static void shellPreparePrintf( char *z; va_start(ap, zFmt); z = sqlite3_vmprintf(zFmt, ap); + va_end(ap); if( z==0 ){ *pRc = SQLITE_NOMEM; }else{ |