mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:18:11 +00:00
Kernel: Handle OOM failures in find_shebang_interpreter_for_executable
This commit is contained in:
parent
8cf0e4a5e4
commit
d1433c35b0
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