[php-src] master: Remove redundant check in pdo_raise_impl_error (#13851)

From: Date: Sun, 31 Mar 2024 14:16:22 +0000
Subject: [php-src] master: Remove redundant check in pdo_raise_impl_error (#13851)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-127909@lists.php.net to get a copy of this message
Author: Niels Dossche (nielsdos) Committer: GitHub (web-flow) Pusher: nielsdos Date: 2024-03-31T16:16:17+02:00 Commit: https://github.com/php/php-src/commit/eaaf175bbbf58c9ba0c25082ce1484fc3bee5334 Raw diff: https://github.com/php/php-src/commit/eaaf175bbbf58c9ba0c25082ce1484fc3bee5334.diff Remove redundant check in pdo_raise_impl_error (#13851) dbh is always non-NULL because it is dereferenced at the start of the function. Changed paths: M ext/pdo/pdo_dbh.c Diff: 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;

« previous php.cvs (#127909) next »