From 02a883df0e987660f04a273a456bd5049a2c9cde Mon Sep 17 00:00:00 2001 From: Pradish Date: Sat, 6 Jul 2024 17:52:25 +0530 Subject: [PATCH] =?UTF-8?q?Fix=20for=20Potential=20memory=20leak=20in=20cl?= =?UTF-8?q?ass=20ServiceArgumentParser's=20Constr=E2=80=A6=20(#8368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osquery/main/windows/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osquery/main/windows/main.cpp b/osquery/main/windows/main.cpp index 255e97f6ee3..e58c0ec38e8 100644 --- a/osquery/main/windows/main.cpp +++ b/osquery/main/windows/main.cpp @@ -89,6 +89,7 @@ class ServiceArgumentParser { LPWSTR* wargv = ::CommandLineToArgvW(::GetCommandLineW(), &wargc); if (wargv != nullptr) { + owns_argv_ptrs_ = true; for (int i = 0; i < wargc; i++) { LPSTR arg = toMBString(wargv[i]); @@ -99,7 +100,6 @@ class ServiceArgumentParser { } args_.push_back(arg); } - owns_argv_ptrs_ = true; ::LocalFree(wargv); } }