Hi Nikita!

You have commented on <https://bugs.php.net/bug.php?id=72828>:

| Unless the allocations explicitly use the system allocator (i.e. do
| not use emalloc and variants), do NOT introduce NULL checks.

Can you please elaborate, why that shouldn't be done.

Actually, the allocations use safe_emalloc() and emalloc(),
respectively[1].  However, the only client of the function does
explicitly check for a NULL return[2], which can only happen, if
safe_emalloc() fails.  So if no NULL checks should be done, this one
should be removed as well.

[1]
<https://github.com/php/php-src/blob/php-5.6.24/ext/standard/string.c#L2926-L2927>
[2]
<https://github.com/php/php-src/blob/php-5.6.24/ext/standard/string.c#L3133-L3134>

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to