From 1dc557424541f156357ced93a2f87f0fab9e05aa Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Wed, 12 Aug 2020 01:10:20 +0430 Subject: [PATCH] Shell: Eliminate reference leak in AST::Execute::run() --- Shell/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/AST.cpp b/Shell/AST.cpp index 07864b734e..9c9712c293 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -889,7 +889,7 @@ RefPtr Execute::run(RefPtr 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;