]> granicus.if.org Git - php/commitdiff
Fix segfault in debug build
authorAndrey Hristov <andrey@php.net>
Thu, 8 Nov 2007 17:29:42 +0000 (17:29 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 8 Nov 2007 17:29:42 +0000 (17:29 +0000)
ext/mysqlnd/mysqlnd.c

index 5d4e3c59887c978d22b51d079249bfac85f3e3bd..302ee4eb52878edf9ac23df41e0b015212049e1a 100644 (file)
@@ -571,6 +571,10 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn,
                                                                                            NULL /*ctx*/, &errstr, &errcode);
        DBG_INF_FMT("stream=%p", conn->net.stream);
 
+       if (errstr || !conn->net.stream) {
+               goto err;
+       }
+
        if (hashed_details) {
                /*
                  If persistent, the streams register it in EG(persistent_list).
@@ -597,10 +601,6 @@ PHPAPI MYSQLND *mysqlnd_connect(MYSQLND *conn,
                mnd_efree(hashed_details);
        }
 
-       if (errstr || !conn->net.stream) {
-               goto err;
-       }
-
        if (conn->options.timeout_read)
        {
                tv.tv_sec = conn->options.timeout_read;