diff --git a/NEWS b/NEWS index faae0d71369..295425d6710 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,9 @@ PHP NEWS . Fixed bugs GH-15908 and GH-15026 (leak / assertion failure in streams.c). (nielsdos) +- TSRM: + . Prevent closing of unrelated handles. (cmb) + - Zip: . Added ZipArchive::ER_TRUNCATED_ZIP added in libzip 1.11. (Remi) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 52fbc95bbd4..4b8445542fc 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -708,6 +708,7 @@ TSRM_API int shmget(key_t key, size_t size, int flags) if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) { if (NULL != shm->segment) { CloseHandle(shm->segment); + shm->segment = INVALID_HANDLE_VALUE; } UnmapViewOfFile(shm->descriptor); shm->descriptor = NULL;