johannes                                 Mon, 16 May 2011 10:15:28 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=311072

Log:
- Move the access behind the check.
# I can't find an unsafe call, but let's play safe

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_net.c
    U   php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_net.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_net.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_net.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_net.c      2011-05-16 
08:08:34 UTC (rev 311071)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_net.c      2011-05-16 
10:15:28 UTC (rev 311072)
@@ -906,11 +906,11 @@
 PHPAPI void
 mysqlnd_net_free(MYSQLND_NET * const net TSRMLS_DC)
 {
-       zend_bool pers = net->persistent;
-
        DBG_ENTER("mysqlnd_net_free");

        if (net) {
+               zend_bool pers = net->persistent;
+
                net->m.free_contents(net TSRMLS_CC);
                if (net->cmd_buffer.buffer) {
                        DBG_INF("Freeing cmd buffer");

Modified: php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_net.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_net.c      2011-05-16 
08:08:34 UTC (rev 311071)
+++ php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_net.c      2011-05-16 
10:15:28 UTC (rev 311072)
@@ -905,11 +905,11 @@
 PHPAPI void
 mysqlnd_net_free(MYSQLND_NET * const net TSRMLS_DC)
 {
-       zend_bool pers = net->persistent;
-
        DBG_ENTER("mysqlnd_net_free");

        if (net) {
+               zend_bool pers = net->persistent;
+
                net->m.free_contents(net TSRMLS_CC);
                if (net->cmd_buffer.buffer) {
                        DBG_INF("Freeing cmd buffer");

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_net.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_net.c 2011-05-16 08:08:34 UTC (rev 
311071)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_net.c 2011-05-16 10:15:28 UTC (rev 
311072)
@@ -905,11 +905,11 @@
 PHPAPI void
 mysqlnd_net_free(MYSQLND_NET * const net TSRMLS_DC)
 {
-       zend_bool pers = net->persistent;
-
        DBG_ENTER("mysqlnd_net_free");

        if (net) {
+               zend_bool pers = net->persistent;
+
                net->m.free_contents(net TSRMLS_CC);
                if (net->cmd_buffer.buffer) {
                        DBG_INF("Freeing cmd buffer");

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

Reply via email to