Re: Correct use of zend_list_delete
| From: | Wez Furlong | Date: | Thu, 10 Nov 2005 10:54:26 +0000 |
| Subject: | Re: Correct use of zend_list_delete | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-19945@lists.php.net to get a copy of this message | ||
On 11/9/05, Marco Bambini <marco@vampiresoft.com> wrote:
> ZEND_FUNCTION(rsql_disconnect)
> {
> ...
> ZEND_FETCH_RESOURCE2(rsqldb, void*, theConnectionParameter, -1,
> kConnIDString, rsql_connection, rsql_pconnection);
> if (rsqldb) zend_list_delete(Z_LVAL_PP(theConnectionParameter));
> if (rsqldb) myCustomFree(rsqldb);
Removing the call to myCustomFree should solve your problem; the list
destructor is calling it once for you, and you're then trying to free
somthing that is no longer valid.
--Wez