andrey          Mon Feb  4 17:33:46 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysqli/tests   bug35759.phpt 
    /php-src/ext/mysqlnd        mysqlnd_block_alloc.c mysqlnd_result.c 
  Log:
  Fix a leak, memory warning and failing test case.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug35759.phpt?r1=1.1.2.1.2.1.2.1&r2=1.1.2.1.2.1.2.2&diff_format=u
Index: php-src/ext/mysqli/tests/bug35759.phpt
diff -u php-src/ext/mysqli/tests/bug35759.phpt:1.1.2.1.2.1.2.1 
php-src/ext/mysqli/tests/bug35759.phpt:1.1.2.1.2.1.2.2
--- php-src/ext/mysqli/tests/bug35759.phpt:1.1.2.1.2.1.2.1      Wed Oct 10 
10:10:59 2007
+++ php-src/ext/mysqli/tests/bug35759.phpt      Mon Feb  4 17:33:46 2008
@@ -32,7 +32,9 @@
        $stmt = $mysql->prepare("SELECT * FROM blobby");
        $stmt->execute();
        $stmt->store_result();
-       $params= array_pad(array(), $col_num, "");
+       for ($i = 0; $i < $col_num; $i++) {
+               $params[] = &$col_num;
+       }
        call_user_func_array(array($stmt, "bind_result"), $params);
        $stmt->fetch();
        
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.c?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.2 
php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.3
--- php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.2   Tue Jan 29 22:06:43 2008
+++ php-src/ext/mysqlnd/mysqlnd_block_alloc.c   Mon Feb  4 17:33:46 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_block_alloc.c,v 1.1.2.2 2008/01/29 22:06:43 rrichards Exp $ */
+/* $Id: mysqlnd_block_alloc.c,v 1.1.2.3 2008/02/04 17:33:46 andrey Exp $ */
 
 #include "php.h"
 #include "mysqlnd.h"
@@ -186,6 +186,7 @@
        /* mnd_free will reference LOCK_access and might crash, depending on 
the caller...*/
        mysqlnd_mempool_free_contents(pool TSRMLS_CC);
        mnd_free(pool->arena);
+       mnd_free(pool);
        DBG_VOID_RETURN;
 }
 /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.4.2.11&r2=1.4.2.12&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_result.c
diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.11 
php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.12
--- php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.11       Tue Jan 29 22:06:43 2008
+++ php-src/ext/mysqlnd/mysqlnd_result.c        Mon Feb  4 17:33:46 2008
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: mysqlnd_result.c,v 1.4.2.11 2008/01/29 22:06:43 rrichards Exp $ */
+/* $Id: mysqlnd_result.c,v 1.4.2.12 2008/02/04 17:33:46 andrey Exp $ */
 #include "php.h"
 #include "mysqlnd.h"
 #include "mysqlnd_wireprotocol.h"
@@ -351,8 +351,6 @@
                result->row_packet = NULL;
        }
 
-       result->conn = NULL;
-
        if (result->meta) {
                result->meta->m->free_metadata(result->meta, FALSE TSRMLS_CC);
                result->meta = NULL;
@@ -374,12 +372,14 @@
 void mysqlnd_internal_free_result(MYSQLND_RES *result TSRMLS_DC)
 {
        DBG_ENTER("mysqlnd_internal_free_result");
+
+       result->m.free_result_contents(result TSRMLS_CC);
+
        if (result->conn) {
                result->conn->m->free_reference(result->conn TSRMLS_CC);
                result->conn = NULL;
        }
 
-       result->m.free_result_contents(result TSRMLS_CC);
        efree(result);
 
        DBG_VOID_RETURN;

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

Reply via email to