summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Baratz <adambaratz@php.net>2016-09-21 12:00:19 -0400
committerAdam Baratz <adambaratz@php.net>2016-09-21 12:00:19 -0400
commitb29ad29b916c367527732f8d529bf11fc2854bb0 (patch)
treeefdfd69fe8cbcaf5977e2a1dd1ff40b371b9f5e8
parent56e3ec93a961a346dc290c509df2f1257232b0c3 (diff)
downloadphp-git-b29ad29b916c367527732f8d529bf11fc2854bb0.tar.gz
Move dtor before memory freed to avoid invalid read
-rw-r--r--ext/pdo_dblib/dblib_driver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 3e0529fa1d..b8ec4fb48e 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -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;
}