aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <Dan Kennedy>2024-12-16 15:13:34 +0000
committerdan <Dan Kennedy>2024-12-16 15:13:34 +0000
commit800bf8fd938c4ffafd8640996f98a6cec3329f8d (patch)
treef86827bca39a9cfe151977b5b3b93bbe42aec5a2 /src
parentd26bb375be00e62cd1cfb1a3f98cd227a9ceb28b (diff)
downloadsqlite-800bf8fd938c4ffafd8640996f98a6cec3329f8d.tar.gz
sqlite-800bf8fd938c4ffafd8640996f98a6cec3329f8d.zip
Fix a problem on this branch causing a file-handle to be leaked following an OOM condition.
FossilOrigin-Name: 5ca12dc964b2d8c3d11a2be5be7eac0dc994cec3a8b5fdfeac4ff8dde19a5a93
Diffstat (limited to 'src')
-rw-r--r--src/os_win.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/os_win.c b/src/os_win.c
index 7867c876e..51171e07c 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -4248,7 +4248,10 @@ static int winOpenSharedMemory(winFile *pDbFd){
p->id = pShmNode->nextShmId++;
#endif
pDbFd->pShm = p;
- }else{
+ }else if( p ){
+ if( p->hShm!=INVALID_HANDLE_VALUE ){
+ osCloseHandle(p->hShm);
+ }
sqlite3_free(p);
}