diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 48c3f00340a..f74f92c221d 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -71,7 +71,7 @@ void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, pdo_error_type sqlst char *message = NULL; const char *msg; - if (dbh && dbh->error_mode == PDO_ERRMODE_SILENT) { + if (dbh->error_mode == PDO_ERRMODE_SILENT) { #if 0 /* BUG: if user is running in silent mode and hits an error at the driver level * when they use the PDO methods to call up the error information, they may @@ -134,7 +134,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */ zend_string *message = NULL; zval info; - if (dbh == NULL || dbh->error_mode == PDO_ERRMODE_SILENT) { + if (dbh->error_mode == PDO_ERRMODE_SILENT) { return; } @@ -197,9 +197,7 @@ PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt) /* {{{ */ zval_ptr_dtor(&info); } - if (message) { - zend_string_release_ex(message, 0); - } + zend_string_release_ex(message, false); if (supp) { efree(supp); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 9ac0ba62108..be5e287111f 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -714,7 +714,7 @@ static void do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */ /* }}} */ /* perform a fetch. - * If return_value is not null, store values into it according to HOW. */ + * Stores values into return_value according to HOW. */ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type how, enum pdo_fetch_orientation ori, zend_long offset, zval *return_all) /* {{{ */ { int flags, idx, old_arg_count = 0; @@ -744,11 +744,6 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h colno = stmt->fetch.column; } - /* If no return value we are done */ - if (!return_value) { - return true; - } - if (how == PDO_FETCH_LAZY) { get_lazy_object(stmt, return_value); return 1;