summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-09-22 15:31:02 +0200
committerAnatol Belski <ab@php.net>2015-09-22 20:05:12 +0200
commit0e843a45820941345d1b1695040ab699cf3a0b2a (patch)
treedba83c16daf0c1a37a2cae7b585a39d4624a6cf0 /TSRM
parente45f67245aaf623935b7a4cabc6aa690ebfe7a7b (diff)
downloadphp-git-0e843a45820941345d1b1695040ab699cf3a0b2a.tar.gz
check for NULL return
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_win32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 7bafd2b7b1..285ab61e48 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -620,6 +620,11 @@ TSRM_API int shmget(int key, int size, int flags)
}
shm = shm_get(key, NULL);
+ if (!shm) {
+ UnmapViewOfFile(shm_handle);
+ UnmapViewOfFile(shm_handle);
+ return -1;
+ }
shm->segment = shm_handle;
shm->info = info_handle;
shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);