Skip to content

Commit 8f55b08

Browse files
authored
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).
1 parent 44d6417 commit 8f55b08

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ext/sqlite3/sqlite3.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,13 +1270,10 @@ PHP_METHOD(SQLite3, openBlob)
12701270
mode = "r+b";
12711271
}
12721272

1273+
// since it is not persistent, php_stream_alloc can't fail
12731274
stream = php_stream_alloc(&php_stream_sqlite3_ops, sqlite3_stream, 0, mode);
1274-
1275-
if (stream) {
1276-
php_stream_to_zval(stream, return_value);
1277-
} else {
1278-
RETURN_FALSE;
1279-
}
1275+
ZEND_ASSERT(stream != NULL);
1276+
php_stream_to_zval(stream, return_value);
12801277
}
12811278
/* }}} */
12821279

0 commit comments

Comments
 (0)