Commit 8f55b0850fd for php.net
commit 8f55b0850fd3ab030fffff3d3764d58d06ea744a
Author: David CARLIER <devnexen@gmail.com>
Date: Tue Jan 20 21:34:50 2026 +0000
ext/sqlite3: Sqlite3::openBlob() code path simplification. (#20969)
* ext/sqlite3: Sqlite3::openBlob() code path simplification.
since the stream is opened in non persistent mode, the failure code path
is dead (so are the missing leaks fixes).
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index da24b037861..6d55409ca45 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1270,13 +1270,10 @@ PHP_METHOD(SQLite3, openBlob)
mode = "r+b";
}
+ // since it is not persistent, php_stream_alloc can't fail
stream = php_stream_alloc(&php_stream_sqlite3_ops, sqlite3_stream, 0, mode);
-
- if (stream) {
- php_stream_to_zval(stream, return_value);
- } else {
- RETURN_FALSE;
- }
+ ZEND_ASSERT(stream != NULL);
+ php_stream_to_zval(stream, return_value);
}
/* }}} */