From ab2c5eebecacbaaa059bce617f5f40477f1248e2 Mon Sep 17 00:00:00 2001 From: Rummskartoffel Date: Sun, 26 Dec 2021 15:52:33 +0100 Subject: [PATCH] Help: Fix memory leak given ambiguous man page title on command line Given a command line with an ambiguous man page title, such as `$ Help uname`, Help would find and try to open all matching pages, leading to bad behavior such as a memory leak, flickering scrollbars, and eventually a crash due to OOM. This commit fixes the issue by making Help only open one page on startup. --- Userland/Applications/Help/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Applications/Help/main.cpp b/Userland/Applications/Help/main.cpp index f57cd2ece7..afebffbfd3 100644 --- a/Userland/Applications/Help/main.cpp +++ b/Userland/Applications/Help/main.cpp @@ -331,6 +331,7 @@ ErrorOr serenity_main(Main::Arguments arguments) history.push(path); open_page(path); set_start_page = true; + break; } }