# unchecked pemalloc() return values

- Thread: https://externals.io/message/16168
- Original archive: https://news-web.php.net/php.internals/16168
- Started by Wez Furlong on 2005-05-07T15:33:43+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #16168 — Wez Furlong — 2005-05-07T15:33:43+00:00

URL: https://externals.io/message/16168#16168

I fixed http://bugs.php.net/bug.php?id=32974 this morning, which was
the result of 3 things going wrong at once.

One of the problems was that the zend_llist functions don't check the
return value from pemalloc().  With this particular bug, malloc()
would fail, even though it was not a low memory condition, and that
would cause a segv when populating the `NULL` element.

I suspect we have a whole bunch of places where we don't check
pemalloc() return values; the question is, are we concerned enough
about them to add in a `NULL` check and raise an E_ERROR?

--Wez.
