com php-src: Fixed use of uninitialized value: ext/pdo/pdo_db h.c
| From: | Xinchen Hui | Date: | Mon, 23 Jun 2014 16:03:02 +0000 |
| Subject: | com php-src: Fixed use of uninitialized value: ext/pdo/pdo_db h.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79028@lists.php.net to get a copy of this message | ||
Commit: ee30cc8a1e016bce8a2828d7755dfb7540a5a40c
Author: Xinchen Hui <laruence@php.net> Tue, 24 Jun 2014 00:03:02 +0800
Parents: 587923ccc837fc22901f3114631bcc3b1b384fcd
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ee30cc8a1e016bce8a2828d7755dfb7540a5a40c
Log:
Fixed use of uninitialized value
Changed paths:
M ext/pdo/pdo_dbh.c
Diff:
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index bb29ae3..34beaf4 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -302,6 +302,7 @@ static PHP_METHOD(PDO, dbh_constructor)
/* is the connection still alive ? */
if (pdbh->methods->check_liveness && FAILURE ==
(pdbh->methods->check_liveness)(pdbh TSRMLS_CC)) {
/* nope... need to kill it */
+ /*??? memory leak */
zend_list_close(le);
pdbh = NULL;
}
@@ -372,6 +373,7 @@ static PHP_METHOD(PDO, dbh_constructor)
le.type = php_pdo_list_entry();
le.ptr = dbh;
+ GC_REFCOUNT(&le) = 1;
if ((zend_hash_str_update_mem(&EG(persistent_list),
(char*)dbh->persistent_id, dbh->persistent_id_len, &le, sizeof(le))) == NULL) {