]> granicus.if.org Git - php/commitdiff
Don't use NULL pointer, always check before use
authorAndrey Hristov <andrey@php.net>
Thu, 27 May 2010 12:39:12 +0000 (12:39 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 27 May 2010 12:39:12 +0000 (12:39 +0000)
ext/mysqlnd/mysqlnd.c

index 567570a3abb39b26a18bc5fe816d9475bff37222..79580dcc31da342100537db8ab7c740a60ce6c9a 100644 (file)
@@ -778,7 +778,9 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn,
                                        }
                                        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);
+                                               }
                                        }
                                }
                        }