tony2001                Sat Jan 27 21:53:26 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/pdo    pdo_stmt.c 
  Log:
  nullify param.parameter and avoid destroying it twice
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.118.2.38.2.13&r2=1.118.2.38.2.14&diff_format=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.13 
php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.14
--- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.13  Mon Jan  1 09:36:04 2007
+++ php-src/ext/pdo/pdo_stmt.c  Sat Jan 27 21:53:26 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_stmt.c,v 1.118.2.38.2.13 2007/01/01 09:36:04 sebastian Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.14 2007/01/27 21:53:26 tony2001 Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -370,6 +370,8 @@
                        } else {
                                zend_hash_index_del(hash, pparam->paramno);
                        }
+                       /* param->parameter is freed by hash dtor */
+                       param->parameter = NULL;
                        return 0;
                }
        }
@@ -428,7 +430,9 @@
                        INIT_PZVAL(param.parameter);
 
                        if (!really_register_bound_param(&param, stmt, 1 
TSRMLS_CC)) {
-                               zval_ptr_dtor(&param.parameter);
+                               if (param.parameter) {
+                                       zval_ptr_dtor(&param.parameter);
+                               }
                                RETURN_FALSE;
                        }
 

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

Reply via email to