mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
ext/pdo: Use zend_object_alloc() for allocating PDORows (#17621)
Follow-up for GH-17606
This commit is contained in:
committed by
GitHub
parent
8d95b3da89
commit
0537968f00
@@ -209,7 +209,7 @@ PDO_API void php_pdo_stmt_set_column_count(pdo_stmt_t *stmt, int new_count)
|
||||
static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
|
||||
{
|
||||
if (Z_ISUNDEF(stmt->lazy_object_ref)) {
|
||||
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
|
||||
pdo_row_t *row = zend_object_alloc(sizeof(pdo_row_t), pdo_row_ce);
|
||||
row->stmt = stmt;
|
||||
zend_object_std_init(&row->std, pdo_row_ce);
|
||||
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
|
||||
@@ -2462,7 +2462,7 @@ void pdo_row_free_storage(zend_object *std)
|
||||
|
||||
zend_object *pdo_row_new(zend_class_entry *ce)
|
||||
{
|
||||
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
|
||||
pdo_row_t *row = zend_object_alloc(sizeof(pdo_row_t), ce);
|
||||
zend_object_std_init(&row->std, ce);
|
||||
|
||||
return &row->std;
|
||||
|
||||
Reference in New Issue
Block a user