diff options
author | Anatol Belski <ab@php.net> | 2015-09-22 15:31:02 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-09-22 20:05:12 +0200 |
commit | 0e843a45820941345d1b1695040ab699cf3a0b2a (patch) | |
tree | dba83c16daf0c1a37a2cae7b585a39d4624a6cf0 /TSRM | |
parent | e45f67245aaf623935b7a4cabc6aa690ebfe7a7b (diff) | |
download | php-git-0e843a45820941345d1b1695040ab699cf3a0b2a.tar.gz |
check for NULL return
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/tsrm_win32.c | 5 |
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); |