aboutsummaryrefslogtreecommitdiff
path: root/ext/async/sqlite3async.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-07-12 12:22:29 +0000
committerdan <dan@noemail.net>2010-07-12 12:22:29 +0000
commitd846c5e047e39fc7b4fe653e5e62523c1b2c81ac (patch)
treed1c832977fe3c8ec2fc3c7496a9b6891cf1fa743 /ext/async/sqlite3async.c
parent599e9d21bbd3ce2d3124af604cb62766324806a3 (diff)
downloadsqlite-d846c5e047e39fc7b4fe653e5e62523c1b2c81ac.tar.gz
sqlite-d846c5e047e39fc7b4fe653e5e62523c1b2c81ac.zip
In the async-IO module, do not increment the open file-counter until after an "open file" event has been added to the event queue. Otherwise, an OOM may cause the system to increment the counter even though no file was successfully opened.
FossilOrigin-Name: 15a190dc5769beb53b89254543e744a964cd86ed
Diffstat (limited to 'ext/async/sqlite3async.c')
-rw-r--r--ext/async/sqlite3async.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/async/sqlite3async.c b/ext/async/sqlite3async.c
index 0590230a5..a351eaa92 100644
--- a/ext/async/sqlite3async.c
+++ b/ext/async/sqlite3async.c
@@ -1143,7 +1143,6 @@ static int asyncOpen(
async_mutex_leave(ASYNC_MUTEX_LOCK);
if( rc==SQLITE_OK ){
- incrOpenFileCount();
pData->pLock = pLock;
}
@@ -1160,7 +1159,10 @@ static int asyncOpen(
}
if( rc!=SQLITE_OK ){
p->pMethod = 0;
+ }else{
+ incrOpenFileCount();
}
+
return rc;
}