iliaa           Mon Aug  7 17:32:13 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/pdo    pdo_dbh.c 
  Log:
  Fixed memory leak with persistent connections
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.5&r2=1.82.2.31.2.6&diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.5 
php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.6
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.5     Mon Jul 31 20:18:11 2006
+++ php-src/ext/pdo/pdo_dbh.c   Mon Aug  7 17:32:13 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.5 2006/07/31 20:18:11 iliaa Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.6 2006/08/07 17:32:13 iliaa Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -342,7 +342,9 @@
                        /* switch over to the persistent one */
                        dbh = pdbh;
                        zend_object_store_set_object(object, dbh TSRMLS_CC);
-                       dbh->refcount++;
+                       if (!call_factory) {
+                               dbh->refcount++;
+                       }
                }
 
                if (hashkey) {
@@ -1399,6 +1401,10 @@
                pefree(dbh->password, dbh->is_persistent);
        }
        
+       if (dbh->persistent_id) {
+               pefree((char *)dbh->persistent_id, dbh->is_persistent);
+       }
+
        if (dbh->def_stmt_ctor_args) {
                zval_ptr_dtor(&dbh->def_stmt_ctor_args);
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to