Before freeing stmt in destructor check if dbh driver data is NULL (#829)
* Issue 434 - set dbh driver data to NULL as well in destructor * Reverted the last change but instead check if dbh driver_data is already freed * Modified the comment
This commit is contained in:
parent
ba9579b504
commit
909d1fa130
|
@ -496,8 +496,13 @@ int pdo_sqlsrv_stmt_dtor( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
|
|||
LOG( SEV_NOTICE, "pdo_sqlsrv_stmt_dtor: entering" );
|
||||
|
||||
// if a PDO statement didn't complete preparation, its driver_data can be NULL
|
||||
if( driver_stmt == NULL ) {
|
||||
if (driver_stmt == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// occasionally stmt->dbh->driver_data is already freed and reset but its driver_data is not
|
||||
if (stmt->dbh != NULL && stmt->dbh->driver_data == NULL) {
|
||||
stmt->driver_data = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue