diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/bz2/bz2_filter.c | 15 | ||||
| -rw-r--r-- | ext/mbstring/php_mbregex.c | 3 | ||||
| -rw-r--r-- | ext/openssl/xp_ssl.c | 3 | ||||
| -rw-r--r-- | ext/pdo/pdo_dbh.c | 4 | ||||
| -rw-r--r-- | ext/standard/array.c | 18 | ||||
| -rw-r--r-- | ext/standard/user_filters.c | 4 |
6 files changed, 2 insertions, 45 deletions
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index cb70888284..6446e29ad9 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -315,10 +315,6 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi /* Create this filter */ data = pecalloc(1, sizeof(php_bz2_filter_data), persistent); - if (!data) { - php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", sizeof(php_bz2_filter_data)); - return NULL; - } /* Circular reference */ data->strm.opaque = (void *) data; @@ -328,19 +324,8 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi data->persistent = persistent; data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; data->strm.next_in = data->inbuf = (char *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->inbuf_len); - pefree(data, persistent); - return NULL; - } data->strm.avail_in = 0; data->strm.next_out = data->outbuf = (char *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL, E_WARNING, "Failed allocating %zu bytes", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } if (strcasecmp(filtername, "bzip2.decompress") == 0) { data->small_footprint = 0; diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 998d9a7072..a2389df880 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -88,9 +88,6 @@ zend_mb_regex_globals *php_mb_regex_globals_alloc(void) { zend_mb_regex_globals *pglobals = pemalloc( sizeof(zend_mb_regex_globals), 1); - if (!pglobals) { - return NULL; - } if (SUCCESS != _php_mb_regex_globals_ctor(pglobals)) { pefree(pglobals, 1); return NULL; diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 65693c23c7..a2d6860ecd 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1431,9 +1431,6 @@ static unsigned char *alpn_protos_parse(unsigned short *outlen, const char *in) } out = emalloc(strlen(in) + 1); - if (!out) { - return NULL; - } for (i = 0; i <= len; ++i) { if (i == len || in[i] == ',') { diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 586797e744..4cfd01020f 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1294,9 +1294,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind) return 0; } - if (!(dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent))) { - php_error_docref(NULL, E_ERROR, "out of memory while allocating PDO methods."); - } + dbh->cls_methods[kind] = pemalloc(sizeof(HashTable), dbh->is_persistent); zend_hash_init_ex(dbh->cls_methods[kind], 8, NULL, dbh->is_persistent? cls_method_pdtor : cls_method_dtor, dbh->is_persistent, 0); diff --git a/ext/standard/array.c b/ext/standard/array.c index 94343dc45e..d3c8dae19b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4487,10 +4487,6 @@ PHP_FUNCTION(array_unique) /* create and sort array with pointers to the target_hash buckets */ arTmp = (struct bucketindex *) pemalloc((Z_ARRVAL_P(array)->nNumOfElements + 1) * sizeof(struct bucketindex), Z_ARRVAL_P(array)->u.flags & HASH_FLAG_PERSISTENT); - if (!arTmp) { - zval_dtor(return_value); - RETURN_FALSE; - } for (i = 0, idx = 0; idx < Z_ARRVAL_P(array)->nNumUsed; idx++) { p = Z_ARRVAL_P(array)->arData + idx; if (Z_TYPE(p->val) == IS_UNDEF) continue; @@ -4781,13 +4777,6 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int } hash = Z_ARRVAL(args[i]); list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), hash->u.flags & HASH_FLAG_PERSISTENT); - if (!list) { - PHP_ARRAY_CMP_FUNC_RESTORE(); - - efree(ptrs); - efree(lists); - RETURN_FALSE; - } lists[i] = list; ptrs[i] = list; for (idx = 0; idx < hash->nNumUsed; idx++) { @@ -5203,13 +5192,6 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } hash = Z_ARRVAL(args[i]); list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), hash->u.flags & HASH_FLAG_PERSISTENT); - if (!list) { - PHP_ARRAY_CMP_FUNC_RESTORE(); - - efree(ptrs); - efree(lists); - RETURN_FALSE; - } lists[i] = list; ptrs[i] = list; for (idx = 0; idx < hash->nNumUsed; idx++) { diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 4d7d76d13f..b0205094d9 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -508,9 +508,7 @@ PHP_FUNCTION(stream_bucket_new) php_stream_from_zval(stream, zstream); - if (!(pbuffer = pemalloc(buffer_len, php_stream_is_persistent(stream)))) { - RETURN_FALSE; - } + pbuffer = pemalloc(buffer_len, php_stream_is_persistent(stream)); memcpy(pbuffer, buffer, buffer_len); |
