]> granicus.if.org Git - php/commitdiff
null the value before usage
authorAndrey Hristov <andrey@php.net>
Sat, 8 Oct 2011 14:48:14 +0000 (14:48 +0000)
committerAndrey Hristov <andrey@php.net>
Sat, 8 Oct 2011 14:48:14 +0000 (14:48 +0000)
ext/mysqli/mysqli_prop.c

index b946ab2bd8c66c4f583070d7282ffc94f2879754..d19b98c8ef94d79a83094a22a191fb906a70aca8 100644 (file)
@@ -209,14 +209,13 @@ static int link_stat_read(mysqli_object *obj, zval **retval TSRMLS_DC)\
        MY_MYSQL *mysql;
 
        MAKE_STD_ZVAL(*retval);
+       ZVAL_NULL(*retval);
 
-       CHECK_STATUS(MYSQLI_STATUS_VALID);
+       CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
 
        mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr;
 
-       if (!mysql) {
-               ZVAL_NULL(*retval);
-       } else {
+       if (mysql) {
                char * stat_msg;
 #if defined(MYSQLI_USE_MYSQLND)
                uint stat_msg_len;