mirror of
https://github.com/php/php-src.git
synced 2024-12-05 07:46:06 +08:00
Added check for calloc() failure
This commit is contained in:
parent
6ee2602317
commit
1fcdd25e83
@ -211,6 +211,11 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
|
|||||||
/* creating segment here */
|
/* creating segment here */
|
||||||
*shared_segments_count = 1;
|
*shared_segments_count = 1;
|
||||||
*shared_segments_p = (zend_shared_segment **) calloc(1, sizeof(zend_shared_segment)+sizeof(void *));
|
*shared_segments_p = (zend_shared_segment **) calloc(1, sizeof(zend_shared_segment)+sizeof(void *));
|
||||||
|
if (!*shared_segments_p) {
|
||||||
|
zend_win_error_message(ACCEL_LOG_FATAL, "calloc() failed");
|
||||||
|
*error_in = "calloc";
|
||||||
|
return ALLOC_FAILURE;
|
||||||
|
}
|
||||||
shared_segment = (zend_shared_segment *)((char *)(*shared_segments_p) + sizeof(void *));
|
shared_segment = (zend_shared_segment *)((char *)(*shared_segments_p) + sizeof(void *));
|
||||||
(*shared_segments_p)[0] = shared_segment;
|
(*shared_segments_p)[0] = shared_segment;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user