com php-src: Fix PdoRow leak: ext/pdo/pdo_stmt.c
| From: | Nikita Popov | Date: | Thu, 16 Apr 2015 19:08:29 +0000 |
| Subject: | com php-src: Fix PdoRow leak: ext/pdo/pdo_stmt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86340@lists.php.net to get a copy of this message | ||
Commit: 3d7959c87b260b38022bf737252ac79e622c8837
Author: Nikita Popov <nikic@php.net> Thu, 16 Apr 2015 18:04:09 +0200
Parents: 5b0d86edccb669b06bcf9f225a981f16c03da71a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3d7959c87b260b38022bf737252ac79e622c8837
Log:
Fix PdoRow leak
PdoStatement should only hold a weakref to the PdoRow.
Changed paths:
M ext/pdo/pdo_stmt.c
Diff:
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 346aba7..be22a0e 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -262,7 +262,8 @@ static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */
zend_object_std_init(&row->std, pdo_row_ce);
ZVAL_OBJ(&stmt->lazy_object_ref, &row->std);
row->std.handlers = &pdo_row_object_handlers;
- stmt->std.gc.refcount++;
+ GC_REFCOUNT(&stmt->std)++;
+ GC_REFCOUNT(&row->std)--;
}
ZVAL_COPY(return_value, &stmt->lazy_object_ref);
}