cvs: pear /DB/DB common.php
| From: | Tomas V.V.Cox | Date: | Sat, 07 Jun 2003 19:20:07 +0000 |
| Subject: | cvs: pear /DB/DB common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-10758@lists.php.net to get a copy of this message | ||
cox Sat Jun 7 15:20:07 2003 EDT
Modified files:
/pear/DB/DB common.php
Log:
Fix a mem leak with emulated prepare/execute, bugs #18494 and #20999
(some driver freeResult() clean-ups to come)
Index: pear/DB/DB/common.php
diff -u pear/DB/DB/common.php:1.17 pear/DB/DB/common.php:1.18
--- pear/DB/DB/common.php:1.17 Sat Jun 7 14:34:49 2003
+++ pear/DB/DB/common.php Sat Jun 7 15:20:06 2003
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: common.php,v 1.17 2003/06/07 18:34:49 cox Exp $
+// $Id: common.php,v 1.18 2003/06/07 19:20:06 cox Exp $
//
// Base class for DB implementations.
//
@@ -558,7 +558,12 @@
if (DB::isError($realquery)) {
return $realquery;
}
- $result = $this->simpleQuery($realquery);
+ $result = $this->simpleQuery($realquery);
+ // Free the internal prepared vars
+ unset($this->prepare_tokens[$stmt]);
+ unset($this->prepare_types[$stmt]);
+ unset($this->prepared_queries[$stmt]);
+
if (DB::isError($result) || $result === DB_OK) {
return $result;
} else {