Newsgroups: php.internals,php.pdo Path: news.php.net Xref: news.php.net php.internals:87193 php.pdo:546 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78534 invoked from network); 16 Jul 2015 01:16:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2015 01:16:41 -0000 Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain oracle.com designates 141.146.126.69 as permitted sender) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 141.146.126.69 aserp1040.oracle.com Received: from [141.146.126.69] ([141.146.126.69:24612] helo=aserp1040.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/11-05015-7F507A55 for ; Wed, 15 Jul 2015 21:16:40 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t6G1Ga7F020743 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Jul 2015 01:16:36 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t6G1Gan5011806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 16 Jul 2015 01:16:36 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t6G1GZld027421; Thu, 16 Jul 2015 01:16:35 GMT Received: from [10.191.134.64] (/10.191.134.64) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 15 Jul 2015 18:16:35 -0700 To: PHP Internals Cc: pdo@lists.php.net Message-ID: <55A705F8.6010404@oracle.com> Date: Thu, 16 Jul 2015 11:16:40 +1000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0021.oracle.com [156.151.31.71] Subject: Reordering PDO statement dtor sequence? From: christopher.jones@oracle.com (Christopher Jones) We are looking at reordering the PDO statement-free dtors to fix a resource leak in PDO_OCI. Let me know if this will affect other drivers. Chris *** pdo_stmt.c.orig 2015-07-15 09:56:18.986187123 -0700 --- pdo_stmt.c 2015-07-15 09:57:22.292453715 -0700 *************** *** 2300,2305 **** --- 2300,2309 ---- PDO_API void php_pdo_free_statement(pdo_stmt_t *stmt) { + + if (stmt->methods && stmt->methods->dtor) { + stmt->methods->dtor(stmt); + } if (stmt->bound_params) { zend_hash_destroy(stmt->bound_params); FREE_HASHTABLE(stmt->bound_params); *************** *** 2316,2324 **** stmt->bound_columns = NULL; } - if (stmt->methods && stmt->methods->dtor) { - stmt->methods->dtor(stmt); - } if (stmt->query_string) { efree(stmt->query_string); } --- 2320,2325 ---- -- http://twitter.com/ghrd