mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
- Fix #55301 (mssql part) check if malloc succeded
This commit is contained in:
parent
61780c3dbc
commit
9c88553456
1 changed files with 7 additions and 0 deletions
|
@ -685,6 +685,13 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||||
|
|
||||||
/* hash it up */
|
/* hash it up */
|
||||||
mssql_ptr = (mssql_link *) malloc(sizeof(mssql_link));
|
mssql_ptr = (mssql_link *) malloc(sizeof(mssql_link));
|
||||||
|
if (!mssql_ptr) {
|
||||||
|
efree(hashed_details);
|
||||||
|
dbfreelogin(mssql.login);
|
||||||
|
dbclose(mssql.link);
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy(mssql_ptr, &mssql, sizeof(mssql_link));
|
memcpy(mssql_ptr, &mssql, sizeof(mssql_link));
|
||||||
Z_TYPE(new_le) = le_plink;
|
Z_TYPE(new_le) = le_plink;
|
||||||
new_le.ptr = mssql_ptr;
|
new_le.ptr = mssql_ptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue