summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-18 19:28:10 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-18 19:28:10 +0000
commit72b356c1bccb511e9a3414cbfe6ff25b5a20b91f (patch)
treeb5ac19d75d629c064e8e68bd3182b594760f33be /ext/zlib/zlib.c
parent94c25df5923aa6d91c0431fdde940afd3d843f08 (diff)
downloadphp-git-72b356c1bccb511e9a3414cbfe6ff25b5a20b91f.tar.gz
Removed pointless memory allocation checks.
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 0233d25033..1e62e99f8e 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -303,9 +303,7 @@ PHP_FUNCTION(gzfile)
}
/* Initialize return array */
- if (array_init(return_value) == FAILURE) {
- RETURN_FALSE;
- }
+ array_init(return_value);
/* Now loop through the file and do the magic quotes thing if needed */
memset(buf,0,sizeof(buf));
@@ -495,7 +493,6 @@ PHP_FUNCTION(gzuncompress)
do {
length=plength?plength:Z_STRLEN_PP(data)*(1<<factor++);
s2 = (char *) erealloc(s1,length);
- if(! s2) { if(s1) efree(s1); RETURN_FALSE; }
status = uncompress(s2, &length ,Z_STRVAL_PP(data), Z_STRLEN_PP(data));
s1=s2;
} while((status==Z_BUF_ERROR)&&(!plength)&&(factor<maxfactor));
@@ -820,8 +817,6 @@ PHP_FUNCTION(gzencode)
stream.avail_out = stream.avail_in + (stream.avail_in/1000) + 15 + 1; /* room for \0 */
s2 = (char *) emalloc(stream.avail_out+GZIP_HEADER_LENGTH+(coding==CODING_GZIP?GZIP_FOOTER_LENGTH:0));
- if(!s2)
- RETURN_FALSE;
/* add gzip file header */
s2[0] = gz_magic[0];