[php-src] master: Remove redundant check in mysqlnd_fetch_stmt_row_cursor (#13850)
| From: | Niels Dossche via GitHub | Date: | Sun, 31 Mar 2024 14:16:32 +0000 |
| Subject: | [php-src] master: Remove redundant check in mysqlnd_fetch_stmt_row_cursor (#13850) | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-127910@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:27+02:00
Commit: https://github.com/php/php-src/commit/f6447b337e0d01232d1c17591975bf21e1682c53
Raw diff: https://github.com/php/php-src/commit/f6447b337e0d01232d1c17591975bf21e1682c53.diff
Remove redundant check in mysqlnd_fetch_stmt_row_cursor (#13850)
result is always non-NULL because it is dereferenced above.
Similarly, result->unbuf and stmt must also be non-NULL.
Changed paths:
M ext/mysqlnd/mysqlnd_ps.c
Diff:
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 87d0ba738a67..5b81eb8e211e 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -764,7 +764,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES * result, zval **row_ptr, const unsign
DBG_ENTER("mysqlnd_fetch_stmt_row_cursor");
- if (!stmt || !stmt->conn || !result || !result->conn || !result->unbuf) {
+ if (!stmt->conn || !result->conn) {
DBG_ERR("no statement");
DBG_RETURN(FAIL);
}