From ed93ca88e3f05bb4236b58a940ebae2914123b1f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 2 Nov 2022 11:41:19 +0100 Subject: [PATCH] Fix GH-9829: Bug in refactoring Windows shmat() function `shm->addr` cannot be `NULL` here, so the whole check is completely pointless. --- TSRM/tsrm_win32.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 81278d5ab4bd4..22e651739920a 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -691,13 +691,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags) } shm->addr = shm->descriptor + sizeof(shm->descriptor); - - if (NULL == shm->addr) { - int err = GetLastError(); - SET_ERRNO_FROM_WIN32_CODE(err); - return (void*)-1; - } - shm->descriptor->shm_atime = time(NULL); shm->descriptor->shm_lpid = getpid(); shm->descriptor->shm_nattch++;