aboutsummaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-07-23 22:55:10 +0000
committerdrh <drh@noemail.net>2018-07-23 22:55:10 +0000
commit6886d6dbc4bc2f912303db31dd513c64ba8dd214 (patch)
treedf4d189162616b9ed499a77b82d72cc306a76e41 /src/os_unix.c
parentda6dc2404a062a02ff5e0c7ab8ba59a5dfe40965 (diff)
downloadsqlite-6886d6dbc4bc2f912303db31dd513c64ba8dd214.tar.gz
sqlite-6886d6dbc4bc2f912303db31dd513c64ba8dd214.zip
Return an SQLITE_NOMEM error if the locking mutex fails to allocate.
FossilOrigin-Name: 1c94834879be0601ac40ef3c4fb1b140f7737e89af7808f2f1db4ceb3daae19f
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 48067f4cc..aacca93d1 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1373,7 +1373,13 @@ static int findInodeInfo(
}
memset(pInode, 0, sizeof(*pInode));
memcpy(&pInode->fileId, &fileId, sizeof(fileId));
- pInode->pLockMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
+ if( sqlite3GlobalConfig.bCoreMutex ){
+ pInode->pLockMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
+ if( pInode->pLockMutex==0 ){
+ sqlite3_free(pInode);
+ return SQLITE_NOMEM_BKPT;
+ }
+ }
pInode->nRef = 1;
pInode->pNext = inodeList;
pInode->pPrev = 0;