summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 73511b2639..b4a8b27fa4 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2018 The PHP Group |
+ | Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -200,7 +200,9 @@ static void mysqli_objects_free_storage(zend_object *object)
mysqli_object *intern = php_mysqli_fetch_object(object);
MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr;
- my_efree(my_res);
+ if (my_res) {
+ efree(my_res);
+ }
zend_object_std_dtor(&intern->zo);
}
/* }}} */
@@ -331,7 +333,7 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl
/* }}} */
/* {{{ mysqli_write_property */
-void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot)
+zval *mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zval tmp_member;
mysqli_object *obj;
@@ -351,12 +353,14 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache
if (hnd) {
hnd->write_func(obj, value);
} else {
- zend_std_write_property(object, member, value, cache_slot);
+ value = zend_std_write_property(object, member, value, cache_slot);
}
if (member == &tmp_member) {
zval_ptr_dtor_str(&tmp_member);
}
+
+ return value;
}
/* }}} */
@@ -1265,7 +1269,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
ZVAL_COPY_VALUE(&dataset, return_value);
- object_and_properties_init(return_value, ce, NULL);
+ object_init_ex(return_value, ce);
if (!ce->default_properties_count && !ce->__set) {
Z_OBJ_P(return_value)->properties = Z_ARR(dataset);
} else {
@@ -1311,12 +1315,3 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
}
/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */