Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release objects and free memory obtained from COM #7999

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

dreamer-dead
Copy link
Contributor

It seems to me that the COM objects and strings from PR #7963 should be released.

@marcosd4h PTAL

@dreamer-dead dreamer-dead requested review from a team as code owners April 20, 2023 20:27
@@ -431,6 +431,9 @@ Expected<WmiRequest, WmiError> WmiRequest::CreateWmiRequest(
&authInfo,
&ifCapabilites);
if (FAILED(hr)) {
CoTaskMemFree(serverPrincName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://learn.microsoft.com/en-us/windows/win32/api/objidl/nf-objidl-iclientsecurity-queryblanket

[out] pServerPrincName
The current principal name. The string will be allocated by the callee using the [CoTaskMemAlloc](https://learn.microsoft.com/en-us/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemalloc) function and must be freed by the caller using the [CoTaskMemFree](https://learn.microsoft.com/en-us/windows/desktop/api/combaseapi/nf-combaseapi-cotaskmemfree) function.

@Smjert Smjert added the Windows label Apr 25, 2023
Copy link
Contributor

@marcosd4h marcosd4h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me!

@Smjert Smjert merged commit 51e0c6d into osquery:master Apr 27, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants