mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
Kernel: Handle OOM failures in find_shebang_interpreter_for_executable
This commit is contained in:
parent
8cf0e4a5e4
commit
d1433c35b0
Notes:
sideshowbarker
2024-07-17 20:12:03 +09:00
Author: https://github.com/IdanHo
Commit: d1433c35b0
Pull-request: https://github.com/SerenityOS/serenity/pull/12128
Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 2 additions and 2 deletions
|
@ -691,7 +691,7 @@ static ErrorOr<NonnullOwnPtrVector<KString>> find_shebang_interpreter_for_execut
|
|||
if (first_page[i] == ' ') {
|
||||
if (word_length > 0) {
|
||||
auto word = TRY(KString::try_create(StringView { &first_page[word_start], word_length }));
|
||||
interpreter_words.append(move(word));
|
||||
TRY(interpreter_words.try_append(move(word)));
|
||||
}
|
||||
word_length = 0;
|
||||
word_start = i + 1;
|
||||
|
@ -700,7 +700,7 @@ static ErrorOr<NonnullOwnPtrVector<KString>> find_shebang_interpreter_for_execut
|
|||
|
||||
if (word_length > 0) {
|
||||
auto word = TRY(KString::try_create(StringView { &first_page[word_start], word_length }));
|
||||
interpreter_words.append(move(word));
|
||||
TRY(interpreter_words.try_append(move(word)));
|
||||
}
|
||||
|
||||
if (!interpreter_words.is_empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue