iliaa           Mon May  8 14:33:00 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/pdo_pgsql      pgsql_driver.c pgsql_statement.c 
  Log:
  Fixed memory leaks when working with cursors in PDO PostgreSQL driver.
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_driver.c?r1=1.53.2.14&r2=1.53.2.14.2.1&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_driver.c
diff -u php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14 
php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14.2.1
--- php-src/ext/pdo_pgsql/pgsql_driver.c:1.53.2.14      Sun Apr  9 08:17:50 2006
+++ php-src/ext/pdo_pgsql/pgsql_driver.c        Mon May  8 14:33:00 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_driver.c,v 1.53.2.14 2006/04/09 08:17:50 wez Exp $ */
+/* $Id: pgsql_driver.c,v 1.53.2.14.2.1 2006/05/08 14:33:00 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -229,6 +229,9 @@
                PDO_CURSOR_FWDONLY TSRMLS_CC) == PDO_CURSOR_SCROLL;
 
        if (scrollable) {
+               if (S->cursor_name) {
+                       efree(S->cursor_name);
+               }
                /* TODO: check how scrollable cursors related to prepared 
statements */
                spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned 
int) stmt);
        }
http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.31.2.12&r2=1.31.2.12.2.1&diff_format=u
Index: php-src/ext/pdo_pgsql/pgsql_statement.c
diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12 
php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12.2.1
--- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.12   Mon Mar 27 20:51:01 2006
+++ php-src/ext/pdo_pgsql/pgsql_statement.c     Mon May  8 14:33:00 2006
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pgsql_statement.c,v 1.31.2.12 2006/03/27 20:51:01 wez Exp $ */
+/* $Id: pgsql_statement.c,v 1.31.2.12.2.1 2006/05/08 14:33:00 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -341,6 +341,7 @@
                
                spprintf(&q, 0, "FETCH %s %ld FROM %s", ori_str, offset, 
S->cursor_name);
                S->result = PQexec(S->H->server, q);
+               efree(q);
                status = PQresultStatus(S->result);
 
                if (status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) {

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

Reply via email to