]> granicus.if.org Git - php/commitdiff
Fixed use of uninitialized value
authorXinchen Hui <laruence@php.net>
Mon, 23 Jun 2014 16:03:02 +0000 (00:03 +0800)
committerXinchen Hui <laruence@php.net>
Mon, 23 Jun 2014 16:03:02 +0000 (00:03 +0800)
ext/pdo/pdo_dbh.c

index bb29ae3b2ebee3f4246a38cde34912fe4b8e9aae..34beaf43fd84c172076f0afbc04684566ea8aadb 100644 (file)
@@ -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) {