Pārlūkot izejas kodu

Shell: Eliminate reference leak in AST::Execute::run()

AnotherTest 5 gadi atpakaļ
vecāks
revīzija
1dc5574245
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      Shell/AST.cpp

+ 1 - 1
Shell/AST.cpp

@@ -889,7 +889,7 @@ RefPtr<Value> Execute::run(RefPtr<Shell> shell)
         }
         auto& last_in_commands = commands.last();
 
-        last_in_commands.redirections.prepend(*new FdRedirection(STDOUT_FILENO, pipefd[1], Rewiring::Close::Destination));
+        last_in_commands.redirections.prepend(adopt(*new FdRedirection(STDOUT_FILENO, pipefd[1], Rewiring::Close::Destination)));
         last_in_commands.should_wait = true;
         last_in_commands.should_notify_if_in_background = false;
         last_in_commands.is_pipe_source = false;