Skip to content

Commit

Permalink
Fix for Potential memory leak in class ServiceArgumentParser's Constr… (
Browse files Browse the repository at this point in the history
  • Loading branch information
pradishmp authored Jul 6, 2024
1 parent a79dfd5 commit 02a883d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osquery/main/windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -99,7 +100,6 @@ class ServiceArgumentParser {
}
args_.push_back(arg);
}
owns_argv_ptrs_ = true;
::LocalFree(wargv);
}
}
Expand Down

0 comments on commit 02a883d

Please sign in to comment.