com php-src: Fixed memory leaks: ext/pdo/pdo_stmt.c
Commit: 8915ad69fbb0f60898f962a67efa8f1b9ebced5a
Author: Dmitry Stogov <dmitry@zend.com> Tue, 6 May 2014 04:06:58 +0400
Parents: 28a81353313e251e32658cc455cf30913bbc2bd8
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8915ad69fbb0f60898f962a67efa8f1b9ebced5a
Log:
Fixed memory leaks
Changed paths:
M ext/pdo/pdo_stmt.c
Diff:
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 45d73fb..a0a3a8b 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -811,7 +811,12 @@ static int do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs TSRMLS_DC)
/
{
/* fci..size is used to check if it is valid */
if (stmt->fetch.cls.fci.size && stmt->fetch.cls.fci.params) {
- efree(stmt->fetch.cls.fci.params);
+ if (!Z_ISUNDEF(stmt->fetch.cls.ctor_args)) {
+ /* Added to free constructor arguments ??? */
+ zend_fcall_info_args_clear(&stmt->fetch.cls.fci, 1);
+ } else {
+ efree(stmt->fetch.cls.fci.params);
+ }
stmt->fetch.cls.fci.params = NULL;
}
Thread (1 message)
- Dmitry Stogov