com php-src: check for NULL return: TSRM/tsrm_win32.c

From: Date: Tue, 22 Sep 2015 18:05:12 +0000
Subject: com php-src: check for NULL return: TSRM/tsrm_win32.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89115@lists.php.net to get a copy of this message
Commit: 0e843a45820941345d1b1695040ab699cf3a0b2a Author: Anatol Belski <ab@php.net> Tue, 22 Sep 2015 15:31:02 +0200 Parents: e45f67245aaf623935b7a4cabc6aa690ebfe7a7b Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0e843a45820941345d1b1695040ab699cf3a0b2a Log: check for NULL return Changed paths: M TSRM/tsrm_win32.c Diff: diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 7bafd2b..285ab61 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);

« previous php.cvs (#89115) next »