]> granicus.if.org Git - php/commitdiff
Fix a crash in the rare case when a persistent connection
authorAndrey Hristov <andrey@php.net>
Fri, 25 Sep 2009 11:38:19 +0000 (11:38 +0000)
committerAndrey Hristov <andrey@php.net>
Fri, 25 Sep 2009 11:38:19 +0000 (11:38 +0000)
is found dead, after CHNG_USER. mysql->mysql will be NULL
and segfault will follow.

ext/mysqli/mysqli_nonapi.c

index 1237458d2783d3633755d2804846c39fe43ff725..2ed19ae2d43858e10780e01e349365fb451c8139 100644 (file)
@@ -216,7 +216,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
                                                                MyG(num_active_persistent) + MyG(num_inactive_persistent));
                goto err;
        }
-       if (!is_real_connect && !mysql->mysql) {
+       if (!mysql->mysql) {
 #if !defined(MYSQLI_USE_MYSQLND)
                if (!(mysql->mysql = mysql_init(NULL))) {
 #else