mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Prevent crash in case of SQL error
This commit is contained in:
parent
4ea10696e8
commit
4e521c92ec
1 changed files with 3 additions and 1 deletions
|
@ -404,7 +404,9 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
|
|||
/* ensure that we free any previous unfetched results */
|
||||
#ifndef PDO_USE_MYSQLND
|
||||
if (S->stmt) {
|
||||
stmt->column_count = (int)mysql_num_fields(S->result);
|
||||
if (S->result) {
|
||||
stmt->column_count = (int)mysql_num_fields(S->result);
|
||||
}
|
||||
mysql_stmt_free_result(S->stmt);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue