From: Andrey Hristov Date: Sat, 8 Oct 2011 14:48:14 +0000 (+0000) Subject: null the value before usage X-Git-Tag: php-5.3.9RC1~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3701485d972df35a81490cd451441d824b895de8;p=php null the value before usage --- diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index b946ab2bd8..d19b98c8ef 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -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;