mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Move dtor before memory freed to avoid invalid read
This commit is contained in:
parent
56e3ec93a9
commit
b29ad29b91
@ -83,6 +83,7 @@ static int dblib_handle_closer(pdo_dbh_t *dbh)
|
||||
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
|
||||
|
||||
if (H) {
|
||||
pdo_dblib_err_dtor(&H->err);
|
||||
if (H->link) {
|
||||
dbclose(H->link);
|
||||
H->link = NULL;
|
||||
@ -93,7 +94,6 @@ static int dblib_handle_closer(pdo_dbh_t *dbh)
|
||||
}
|
||||
pefree(H, dbh->is_persistent);
|
||||
dbh->driver_data = NULL;
|
||||
pdo_dblib_err_dtor(&H->err);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user