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 e1251edc16
commit c95fa280ed

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);
}