cvs: php-src(PHP_5_1) /ext/pdo_pgsql pgsql_driver.c pgsql_statement.c
| From: | Ilia Alshanetsky | Date: | Wed, 30 Nov 2005 23:27:17 +0000 |
| Subject: | cvs: php-src(PHP_5_1) /ext/pdo_pgsql pgsql_driver.c pgsql_statement.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-35531@lists.php.net to get a copy of this message | ||
iliaa Wed Nov 30 18:27:17 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/pdo_pgsql pgsql_statement.c pgsql_driver.c
Log:
Fixed memory leak
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.31.2.5&r2=1.31.2.6&ty=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.5
php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.6
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.5 Mon Nov 28 21:11:38 2005
+++ php-src/ext/pdo_pgsql/pgsql_statement.c Wed Nov 30 18:27:15 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_statement.c,v 1.31.2.5 2005/11/29 02:11:38 wez Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.6 2005/11/30 23:27:15 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -76,7 +76,10 @@
efree(S->param_formats);
S->param_formats = NULL;
}
-
+ if (S->query) {
+ efree(S->query);
+ S->query = NULL;
+ }
#endif
if (S->cursor_name) {
http://cvs.php.net/diff.php/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.53.2.4&r2=1.53.2.5&ty=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.4 php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.5
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.4 Tue Nov 29 13:17:46 2005
+++ php-src/ext/pdo_pgsql/pgsql_driver.c Wed Nov 30 18:27:15 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql_driver.c,v 1.53.2.4 2005/11/29 18:17:46 iliaa Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.5 2005/11/30 23:27:15 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -248,7 +248,7 @@
/* that's all for now; we'll defer the actual prepare until the first execute call */
if (nsql) {
- S->query = nsql;
+ S->query = estrdup(nsql);
} else {
S->query = estrdup(sql);
}