Skip to content

Commit 0537968

Browse files
authored
ext/pdo: Use zend_object_alloc() for allocating PDORows (#17621)
Follow-up for GH-17606
1 parent 8d95b3d commit 0537968

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ PDO_API void php_pdo_stmt_set_column_count(pdo_stmt_t *stmt, int new_count)
209209
static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
210210
{
211211
if (Z_ISUNDEF(stmt->lazy_object_ref)) {
212-
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
212+
pdo_row_t *row = zend_object_alloc(sizeof(pdo_row_t), pdo_row_ce);
213213
row->stmt = stmt;
214214
zend_object_std_init(&row->std, pdo_row_ce);
215215
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
@@ -2462,7 +2462,7 @@ void pdo_row_free_storage(zend_object *std)
24622462

24632463
zend_object *pdo_row_new(zend_class_entry *ce)
24642464
{
2465-
pdo_row_t *row = ecalloc(1, sizeof(pdo_row_t));
2465+
pdo_row_t *row = zend_object_alloc(sizeof(pdo_row_t), ce);
24662466
zend_object_std_init(&row->std, ce);
24672467

24682468
return &row->std;

0 commit comments

Comments
 (0)