Skip to content

Commit 3d7959c

Browse files
committed
Fix PdoRow leak
PdoStatement should only hold a weakref to the PdoRow.
1 parent 5b0d86e commit 3d7959c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
262262
zend_object_std_init(&row->std, pdo_row_ce);
263263
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
264264
row->std.handlers = &pdo_row_object_handlers;
265-
stmt->std.gc.refcount++;
265+
GC_REFCOUNT(&stmt->std)++;
266+
GC_REFCOUNT(&row->std)--;
266267
}
267268
ZVAL_COPY(return_value, &stmt->lazy_object_ref);
268269
}

0 commit comments

Comments
 (0)