From 66d36f19323508f769c5ee6764145c55ddca4795 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:18:31 +0200 Subject: [PATCH] Remove redundant check in pdo_raise_impl_error `dbh` is always non-NULL because it is dereferenced at the start of the function. --- ext/pdo/pdo_dbh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index f74f92c221d0..93e4c0b0a828 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -98,7 +98,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, pdo_error_type sqlst spprintf(&message, 0, "SQLSTATE[%s]: %s", *pdo_err, msg); } - if (dbh && dbh->error_mode != PDO_ERRMODE_EXCEPTION) { + if (dbh->error_mode != PDO_ERRMODE_EXCEPTION) { php_error_docref(NULL, E_WARNING, "%s", message); } else { zval ex, info;