-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 variable in windows data conversation #7024
Conversation
Release variable in `cimDatetimeToUnixtime` i think I got all the returns Fixes: osquery#7018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the scope_guard
strategy for this? As seen in https://github.com/osquery/osquery/pull/7024/files#diff-572b7f350484fd1cc8be8e82ef3948646c04e248e249ef6c0a2a1b7dda592b06R103-R104.
That helps us ensure that the Release()
is called even if more code paths are added later.
That sounds much cleaner. I was wishing for a go style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes scope guard is awesome! Very similar to Go's defer, though cool that it works on a scope basis with RAII.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs (https://docs.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cocreateinstance) seem to indicate we should be good with this.
Upon failure, *ppv contains NULL
I downloaded the CI artifact and ran it on windows, |
CI artifact still seems okay for Kinda makes me wondering about sprinkling this scope_guard release pattern everywhere |
Release variable in
cimDatetimeToUnixtime
i think I got all the returns. It passes CI. I can download and run the resultant
osqueryd
. Not sure if there's much else to manually test hereFixes: #7018