mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/pdo: Use zend_object_alloc() for allocating PDORows (#17621)
Follow-up for GH-17606
This commit is contained in:
parent
8d95b3da89
commit
0537968f00
1 changed files with 2 additions and 2 deletions
|
@ -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) /* {{{ */
|
static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
|
||||||
{
|
{
|
||||||
if (Z_ISUNDEF(stmt->lazy_object_ref)) {
|
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;
|
row->stmt = stmt;
|
||||||
zend_object_std_init(&row->std, pdo_row_ce);
|
zend_object_std_init(&row->std, pdo_row_ce);
|
||||||
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
|
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)
|
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);
|
zend_object_std_init(&row->std, ce);
|
||||||
|
|
||||||
return &row->std;
|
return &row->std;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue