andrey                                   Wed, 26 May 2010 13:47:43 +0000

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

Log:
Don't use conn->net without checking if it is NULL, because
it can be NULL in OOM conditions. This would cause a crash.

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

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-05-26 13:38:05 UTC 
(rev 299784)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-05-26 13:47:43 UTC 
(rev 299785)
@@ -125,7 +125,9 @@
                conn->current_result = NULL;
        }

-       conn->net->m.free_contents(conn->net TSRMLS_CC);
+       if (conn->net) {
+               conn->net->m.free_contents(conn->net TSRMLS_CC);
+       }

        DBG_INF("Freeing memory of members");


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-05-26 13:38:05 UTC (rev 
299784)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-05-26 13:47:43 UTC (rev 
299785)
@@ -125,7 +125,9 @@
                conn->current_result = NULL;
        }

-       conn->net->m.free_contents(conn->net TSRMLS_CC);
+       if (conn->net) {
+               conn->net->m.free_contents(conn->net TSRMLS_CC);
+       }

        DBG_INF("Freeing memory of members");


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

Reply via email to