Skip to content

Commit 6558bda

Browse files
committed
Added NULL check for H->db in firebird_handle_closer
1 parent e96a35b commit 6558bda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ static void firebird_handle_closer(pdo_dbh_t *dbh) /* {{{ */
594594
}
595595
H->in_manually_txn = 0;
596596

597-
if (isc_detach_database(H->isc_status, &H->db)) {
597+
/* isc_detach_database returns 0 on success, 1 on failure. */
598+
if (H->db != NULL && isc_detach_database(H->isc_status, &H->db)) {
598599
php_firebird_error(dbh);
599600
}
600601

0 commit comments

Comments
 (0)