mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
In the CLI, fix a file descriptor leak following OOM and a missing va_end()
call. FossilOrigin-Name: ec36d15a9e349f4295a9e2215dea0a18e9276e0e4ce2d05021e6b467ab7763bb
This commit is contained 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{
|
||||
|
||||
Reference in New Issue
Block a user