}
else
tmpstr = (char *)estrndup(value, value_length);
- if (tmpstr == NULL) {
- return FAILURE;
- }
/* count the number of listed encoding names */
endp = tmpstr + value_length;
n = 1;
zend_bool any_flag = FALSE;
DBG_ENTER("mysqlnd_net::enable_ssl");
- if (!context) {
- DBG_RETURN(FAIL);
- }
if (net->data->options.ssl_key) {
zval key_zval;
zend_bool any_flag = FALSE;
DBG_ENTER("mysqlnd_vio::enable_ssl");
- if (!context) {
- DBG_RETURN(FAIL);
- }
if (net->data->options.ssl_key) {
zval key_zval;
cfg->split_at_recv = (build_flags & ZEND_CFG_RECV_ENTRY) != 0 && (op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0;
cfg->map = block_map = zend_arena_calloc(arena, op_array->last, sizeof(uint32_t));
- if (!block_map) {
- return FAILURE;
- }
/* Build CFG, Step 1: Find basic blocks starts, calculate number of blocks */
BB_START(0);
/* Build CFG, Step 2: Build Array of Basic Blocks */
cfg->blocks = blocks = zend_arena_calloc(arena, sizeof(zend_basic_block), blocks_count);
- if (!blocks) {
- return FAILURE;
- }
blocks_count = -1;
cfg->predecessors = predecessors = (int*)zend_arena_calloc(arena, sizeof(int), edges);
- if (!predecessors) {
- return FAILURE;
- }
-
edges = 0;
for (b = blocks; b < end; b++) {
if (b->flags & ZEND_BB_REACHABLE) {
ssa->rt_constants = (build_flags & ZEND_RT_CONSTANTS);
ssa_blocks = zend_arena_calloc(arena, blocks_count, sizeof(zend_ssa_block));
- if (!ssa_blocks) {
- return FAILURE;
- }
ssa->blocks = ssa_blocks;
/* Compute Variable Liveness */
ZEND_ASSERT(len >= 0);
stack->buf = (int*)zend_arena_calloc(arena, sizeof(*stack->buf), len);
- if (!stack->buf) {
- return FAILURE;
- }
stack->len = 0;
stack->capacity = len;
{
ZEND_ASSERT(len >= 0);
worklist->visited = (zend_bitset)zend_arena_calloc(arena, sizeof(zend_ulong), zend_bitset_len(len));
- if (!worklist->visited) {
- return FAILURE;
- }
return zend_worklist_stack_prepare(arena, &worklist->stack, len);
}
/* Create this filter */
data = pecalloc(1, sizeof(php_consumed_filter_data), persistent);
- if (!data) {
- php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_consumed_filter_data));
- return NULL;
- }
data->persistent = persistent;
data->consumed = 0;
data->offset = ~0;
/* Create this filter */
data = (php_chunked_filter_data *)pecalloc(1, sizeof(php_chunked_filter_data), persistent);
- if (!data) {
- php_error_docref(NULL, E_WARNING, "Failed allocating %zd bytes", sizeof(php_chunked_filter_data));
- return NULL;
- }
data->state = CHUNK_SIZE_START;
data->chunk_size = 0;
data->persistent = persistent;
*left = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent);
*right = (php_stream_bucket*)pecalloc(1, sizeof(php_stream_bucket), in->is_persistent);
- if (*left == NULL || *right == NULL) {
- goto exit_fail;
- }
-
(*left)->buf = pemalloc(length, in->is_persistent);
(*left)->buflen = length;
memcpy((*left)->buf, in->buf, length);
(*right)->is_persistent = in->is_persistent;
return SUCCESS;
-
-exit_fail:
- if (*right) {
- if ((*right)->buf) {
- pefree((*right)->buf, in->is_persistent);
- }
- pefree(*right, in->is_persistent);
- }
- if (*left) {
- if ((*left)->buf) {
- pefree((*left)->buf, in->is_persistent);
- }
- pefree(*left, in->is_persistent);
- }
- return FAILURE;
}
PHPAPI void php_stream_bucket_delref(php_stream_bucket *bucket)
/* Extract dir name from path_translated * and store it in 'path' */
ctx->path_len = strlen(ctx->path);
path = ctx->path = estrndup(SG(request_info).path_translated, ctx->path_len);
- if (!path)
- return FAILURE;
ctx->path_len = zend_dirname(path, ctx->path_len);
DEBUG_MESSAGE("dirname: %s", ctx->path);