andrey                                   Thu, 27 May 2010 12:39:12 +0000

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

Log:
Don't use NULL pointer, always check before use

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-27 12:12:55 UTC 
(rev 299847)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c  2010-05-27 12:39:12 UTC 
(rev 299848)
@@ -778,7 +778,9 @@
                                        }
                                        if (conn->last_query_type == 
QUERY_SELECT) {
                                                MYSQLND_RES * result = 
conn->m->use_result(conn TSRMLS_CC);
-                                               result->m.free_result(result, 
TRUE TSRMLS_CC);
+                                               if (result) {
+                                                       
result->m.free_result(result, TRUE TSRMLS_CC);
+                                               }
                                        }
                                }
                        }

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-05-27 12:12:55 UTC (rev 
299847)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c     2010-05-27 12:39:12 UTC (rev 
299848)
@@ -778,7 +778,9 @@
                                        }
                                        if (conn->last_query_type == 
QUERY_SELECT) {
                                                MYSQLND_RES * result = 
conn->m->use_result(conn TSRMLS_CC);
-                                               result->m.free_result(result, 
TRUE TSRMLS_CC);
+                                               if (result) {
+                                                       
result->m.free_result(result, TRUE TSRMLS_CC);
+                                               }
                                        }
                                }
                        }

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

Reply via email to