summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2006-05-29 16:55:40 +0000
committerMichael Wallner <mike@php.net>2006-05-29 16:55:40 +0000
commit5777060367da4e3c70eb6147d7e7ac2e88e92648 (patch)
treeb6fe52e609ce94cca38c1537bb17a220cbf4f65d /ext/mysqli/mysqli.c
parentc051139ad57cd12ebc829f053d7b2925bea0d6a2 (diff)
downloadphp-git-5777060367da4e3c70eb6147d7e7ac2e88e92648.tar.gz
MFB: Fixed bug #36949 (invalid internal mysqli objects dtor)
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 584cf72efe..2e7945a129 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -135,22 +135,7 @@ void php_clear_mysql(MY_MYSQL *mysql) {
static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
{
mysqli_object *intern = (mysqli_object *)object;
-
- zend_object_std_dtor(&intern->zo TSRMLS_CC);
- efree(intern);
-}
-/* }}} */
-
-/* {{{ mysqli_objects_destroy_object
- */
-static void mysqli_objects_destroy_object(void *object, zend_object_handle handle TSRMLS_DC)
-{
- mysqli_object *intern = (mysqli_object *)object;
- MYSQLI_RESOURCE *my_res;
-
- zend_objects_destroy_object(object, handle TSRMLS_CC);
-
- my_res = (MYSQLI_RESOURCE *)intern->ptr;
+ MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
/* link object */
if (instanceof_function(intern->zo.ce, mysqli_link_class_entry TSRMLS_CC)) {
@@ -179,6 +164,9 @@ static void mysqli_objects_destroy_object(void *object, zend_object_handle handl
}
intern->ptr = NULL;
my_efree(my_res);
+
+ zend_object_std_dtor(&intern->zo TSRMLS_CC);
+ efree(intern);
}
/* }}} */
@@ -361,7 +349,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_
zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,
(void *) &tmp, sizeof(zval *));
- retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) mysqli_objects_destroy_object, (zend_objects_free_object_storage_t) mysqli_objects_free_storage, NULL TSRMLS_CC);
+ retval.handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) mysqli_objects_free_storage, NULL TSRMLS_CC);
retval.handlers = &mysqli_object_handlers;
return retval;