From 8f55b0850fd3ab030fffff3d3764d58d06ea744a Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Tue, 20 Jan 2026 21:34:50 +0000 Subject: [PATCH] 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). --- ext/sqlite3/sqlite3.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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); } /* }}} */