Skip to content

Commit 305f3c2

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
2 parents 314ef0f + 177f87c commit 305f3c2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PHP NEWS
44

55
- Core:
66
. Fixed bug #74149 (static embed SAPI linkage error). (krakjoe)
7+
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
8+
USE_ZEND_ALLOC=0). (Nikita)
79

810
- Date:
911
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
28182818
ZEND_API void * __zend_malloc(size_t len)
28192819
{
28202820
void *tmp = malloc(len);
2821-
if (EXPECTED(tmp)) {
2821+
if (EXPECTED(tmp || !len)) {
28222822
return tmp;
28232823
}
28242824
zend_out_of_memory();
@@ -2834,7 +2834,7 @@ ZEND_API void * __zend_calloc(size_t nmemb, size_t len)
28342834
ZEND_API void * __zend_realloc(void *p, size_t len)
28352835
{
28362836
p = realloc(p, len);
2837-
if (EXPECTED(p)) {
2837+
if (EXPECTED(p || !len)) {
28382838
return p;
28392839
}
28402840
zend_out_of_memory();

0 commit comments

Comments
 (0)