1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

Fix double calls to free_contents if the connection cannot be

opened. mysqlnd have no probs, external code should not have too.
In any case, double call is not needed.
This commit is contained in:
Andrey Hristov
2009-12-22 17:44:42 +00:00
parent e695a83c66
commit 707e86274b

View File

@@ -737,8 +737,6 @@ err:
conn->scheme = NULL;
}
/* This will also close conn->net->stream if it has been opened */
conn->m->free_contents(conn TSRMLS_CC);
MYSQLND_INC_CONN_STATISTIC(&conn->stats, STAT_CONNECT_FAILURE);
DBG_RETURN(FAIL);
@@ -776,6 +774,9 @@ PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn,
object - we are free to kill it!
*/
conn->m->dtor(conn TSRMLS_CC);
} else {
/* This will also close conn->net->stream if it has been opened */
conn->m->free_contents(conn TSRMLS_CC);
}
DBG_RETURN(NULL);
}