Re: freeing p and then accessing it?
| From: | Zeev Suraski | Date: | Wed, 03 Feb 1999 00:48:20 +0000 |
| Subject: | Re: freeing p and then accessing it? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-3851@lists.php.net to get a copy of this message | ||
At 23:39 02/02/99 +0100, Sascha Schumann wrote:
>>From php3_hash.c, line 193+:
>
>if (!p->pData) {
> pefree(p,ht->persistent);
> pefree(p->arKey,ht->persistent);
> return FAILURE;
>}
>
>Looks a little bit wrong to me.
Yep, even though it's pretty harmless. That code should actually be removed completely, since
it implies that PHP handles out of memory errors, which it doesn't. It handles them in one
central place which is the memory manager. The difference here is that the calls may be persistent
and use regular malloc() instead of emalloc(), but I expect this to change as well in the next
version of PHP (the memory manager simply offers way too many features, it's a pity not to use
it for persistant blocks as well).
Zeev
Zeev
--
Zeev Suraski <zeev@zend.com> http://www.zend.com/
For a PGP public key, finger bourbon@netvision.net.il
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net