]> granicus.if.org Git - php/commitdiff
check for NULL return
authorAnatol Belski <ab@php.net>
Tue, 22 Sep 2015 13:31:02 +0000 (15:31 +0200)
committerAnatol Belski <ab@php.net>
Tue, 22 Sep 2015 18:05:12 +0000 (20:05 +0200)
TSRM/tsrm_win32.c

index 7bafd2b7b11f8c5e3051b752f64879afaeed5758..285ab61e48afb04c3616cd093eee9482c94ea9b1 100644 (file)
@@ -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);