diff options
author | dan <dan@noemail.net> | 2010-05-03 17:18:24 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-05-03 17:18:24 +0000 |
commit | 76ed3bc044281ffc608f4a9618174ffba1a30fca (patch) | |
tree | 1c3d508da06a0b5ab892cea37c507c0f73e89d56 /src/os_unix.c | |
parent | 4c846bb14896bc23e4403b01b255acbf37525ee8 (diff) | |
download | sqlite-76ed3bc044281ffc608f4a9618174ffba1a30fca.tar.gz sqlite-76ed3bc044281ffc608f4a9618174ffba1a30fca.zip |
Fix a couple of errors in WAL code that can occur in an OOM situation.
FossilOrigin-Name: 9d3f3736be42ef8ab48b099d4712e08dfca97873
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index ad95c1016..1b3223b52 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4972,8 +4972,8 @@ static int unixShmOpen( nName = strlen(zName); pNew = sqlite3_malloc( sizeof(*pFile) + nName + 10 ); if( pNew==0 ){ - rc = SQLITE_NOMEM; - goto shm_open_err; + sqlite3_free(p); + return SQLITE_NOMEM; } memset(pNew, 0, sizeof(*pNew)); pNew->zFilename = (char*)&pNew[1]; @@ -5059,9 +5059,8 @@ static int unixShmOpen( /* Jump here on any error */ shm_open_err: - unixShmPurge(); + unixShmPurge(); /* This call frees pFile if required */ sqlite3_free(p); - sqlite3_free(pFile); sqlite3_free(pNew); *pShm = 0; unixLeaveMutex(); |