diff options
Diffstat (limited to 'ext/mysqli/mysqli_exception.c')
-rw-r--r-- | ext/mysqli/mysqli_exception.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index 82cf5cd7bf..30ed75ddb7 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -38,7 +38,7 @@ const zend_function_entry mysqli_exception_methods[] = { void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...) { - zval *sql_ex; + zval sql_ex; va_list arg; char *message; @@ -52,26 +52,25 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char return; } - MAKE_STD_ZVAL(sql_ex); - object_init_ex(sql_ex, mysqli_exception_class_entry); + object_init_ex(&sql_ex, mysqli_exception_class_entry); if (message) { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "message", sizeof("message") - 1, + zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "message", sizeof("message") - 1, message TSRMLS_CC); } if (sqlstate) { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1, + zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1, sqlstate TSRMLS_CC); } else { - zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1, + zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1, "00000" TSRMLS_CC); } efree(message); - zend_update_property_long(mysqli_exception_class_entry, sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC); + zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC); - zend_throw_exception_object(sql_ex TSRMLS_CC); + zend_throw_exception_object(&sql_ex TSRMLS_CC); } /* |