From 2ba10ad0c580973a5f6c84ed7e2621e12d2e5358 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 12 Jun 2020 11:34:01 +0200 Subject: Revert accidental change Not sure how this happened, but I seem to have reverted 2fd278bc211c2102422c8d8ce0905dfc43cb5c7f as part of 13868508386208f5a1a43b6c17991ad6f3652fea. Restore the change. --- ext/sqlite3/sqlite3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 895a1b0cfd..c309d5d545 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -135,13 +135,13 @@ PHP_METHOD(SQLite3, open) rc = sqlite3_open_v2(fullpath, &(db_obj->db), flags, NULL); if (rc != SQLITE_OK) { - sqlite3_close(db_obj->db); zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", #ifdef HAVE_SQLITE3_ERRSTR db_obj->db ? sqlite3_errmsg(db_obj->db) : sqlite3_errstr(rc)); #else db_obj->db ? sqlite3_errmsg(db_obj->db) : ""); #endif + sqlite3_close(db_obj->db); if (fullpath != filename) { efree(fullpath); } @@ -151,8 +151,8 @@ PHP_METHOD(SQLite3, open) #ifdef SQLITE_HAS_CODEC if (encryption_key_len > 0) { if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) { - sqlite3_close(db_obj->db); zend_throw_exception_ex(zend_ce_exception, 0, "Unable to open database: %s", sqlite3_errmsg(db_obj->db)); + sqlite3_close(db_obj->db); RETURN_THROWS(); } } -- cgit v1.2.1