File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -496,8 +496,13 @@ int pdo_sqlsrv_stmt_dtor( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
496
496
LOG ( SEV_NOTICE, " pdo_sqlsrv_stmt_dtor: entering" );
497
497
498
498
// if a PDO statement didn't complete preparation, its driver_data can be NULL
499
- if ( driver_stmt == NULL ) {
499
+ if (driver_stmt == NULL ) {
500
+ return 1 ;
501
+ }
500
502
503
+ // if stmt->dbh->driver_data is already freed and but its driver_data is not
504
+ if (stmt->dbh != NULL && stmt->dbh ->driver_data == NULL ) {
505
+ stmt->driver_data = NULL ;
501
506
return 1 ;
502
507
}
503
508
@@ -513,10 +518,6 @@ int pdo_sqlsrv_stmt_dtor( _Inout_ pdo_stmt_t *stmt TSRMLS_DC )
513
518
514
519
stmt->driver_data = NULL ;
515
520
516
- if (stmt->dbh != NULL ) {
517
- stmt->dbh ->driver_data = NULL ;
518
- }
519
-
520
521
return 1 ;
521
522
}
522
523
You can’t perform that action at this time.
0 commit comments