Skip to content

Commit 1e3915c

Browse files
committed
Fix GH-9829: Bug in refactoring Windows shmat() function
`shm->addr` cannot be `NULL` here, so the whole check is completely pointless. Given that this is merely a clean-up and not an actual bug fix, we do without a NEWS entry. Closes GH-9873.
1 parent 8dabbda commit 1e3915c

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

TSRM/tsrm_win32.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
691691
}
692692

693693
shm->addr = shm->descriptor + sizeof(shm->descriptor);
694-
695-
if (NULL == shm->addr) {
696-
int err = GetLastError();
697-
SET_ERRNO_FROM_WIN32_CODE(err);
698-
return (void*)-1;
699-
}
700-
701694
shm->descriptor->shm_atime = time(NULL);
702695
shm->descriptor->shm_lpid = getpid();
703696
shm->descriptor->shm_nattch++;

0 commit comments

Comments
 (0)