#endif
buf = (char *) emalloc(EXEC_INPUT_BUF);
- if (!buf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to emalloc %d bytes for exec buffer", EXEC_INPUT_BUF);
- return -1;
- }
buflen = EXEC_INPUT_BUF;
if (PG(safe_mode)) {
do {
if ( buflen <= (l+1) ) {
buf = erealloc(buf, buflen + EXEC_INPUT_BUF);
- if ( buf == NULL ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to erealloc %d bytes for exec buffer",
- buflen + EXEC_INPUT_BUF);
-#if PHP_SIGCHILD
- signal (SIGCHLD, sig_handler);
-#endif
- return -1;
- }
buflen += EXEC_INPUT_BUF;
}
WRONG_PARAM_COUNT;
}
args = (zval ***)emalloc(argCount * sizeof(zval **));
- if (!args || (zend_get_parameters_array_ex(argCount, args) == FAILURE)) {
+ if (zend_get_parameters_array_ex(argCount, args) == FAILURE) {
efree( args );
WRONG_PARAM_COUNT;
}
do {
szlength=slength*(1<<factor++);
buf = (char *) erealloc(buf,szlength);
- if (!buf) {
- status = 1;
- break;
- }
status = uncompress(buf, &szlength, bufz, slength);
} while ((status==Z_BUF_ERROR)&&(factor<maxfactor));
length -= 2; /* length includes itself */
buffer = emalloc(length);
- if ( !buffer) return;
if (php_stream_read(stream, buffer, (long) length) <= 0) {
efree(buffer);
if (result == NULL) {
/* handle SOFn block */
result = (struct gfxinfo *) ecalloc(1, sizeof(struct gfxinfo));
- if ( !result)
- return NULL;
length = php_read2(stream TSRMLS_CC);
result->bits = php_stream_getc(stream);
result->height = php_read2(stream TSRMLS_CC);
}
result = (struct gfxinfo *)ecalloc(1, sizeof(struct gfxinfo));
- if (!result) {
- return NULL;
- }
dummy_short = php_read2(stream TSRMLS_CC); /* Lsiz */
dummy_short = php_read2(stream TSRMLS_CC); /* Rsiz */
for (zend_hash_internal_pointer_reset(url_stream_wrappers_hash);
zend_hash_get_current_key_ex(url_stream_wrappers_hash, &stream_protocol, &stream_protocol_len, NULL, 0, NULL) == HASH_KEY_IS_STRING;
zend_hash_move_forward(url_stream_wrappers_hash)) {
- if (NULL == (stream_protocols_buf = erealloc(stream_protocols_buf,
- stream_protocols_buf_len + stream_protocol_len + 2 /* ", " */ + 1 /* 0 byte at end */))) {
- break;
- }
+ stream_protocols_buf = erealloc(stream_protocols_buf, stream_protocols_buf_len + stream_protocol_len + 2 + 1);
memcpy(stream_protocols_buf + stream_protocols_buf_len, stream_protocol, stream_protocol_len);
stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len] = ',';
stream_protocols_buf[stream_protocols_buf_len + stream_protocol_len + 1] = ' ';
* could be one though; or more too). */
#define Phonize(c) { \
if (p_idx >= max_buffer_len) { \
- if (NULL == (*phoned_word = erealloc(*phoned_word, max_buffer_len + 2))) { \
- return -1; \
- } \
+ *phoned_word = erealloc(*phoned_word, max_buffer_len + 2); \
max_buffer_len += 2; \
} \
(*phoned_word)[p_idx++] = c; \
if (max_phonemes == 0) { /* Assume largest possible */
max_buffer_len = word_len;
*phoned_word = emalloc(sizeof(char) * word_len + 1);
- if (!*phoned_word)
- return -1;
} else {
max_buffer_len = max_phonemes;
*phoned_word = emalloc(sizeof(char) * max_phonemes + 1);
- if (!*phoned_word)
- return -1;
}
size_t i, j;
result = (char *) emalloc(oldlen * 2 * sizeof(char) + 1);
- if (!result) {
- return result;
- }
for (i = j = 0; i < oldlen; i++) {
result[j++] = hexconvtab[old[i] >> 4];