4

Fix mem leak regression with Windows' sids API by mike-myers-tob · Pull Request...

 2 years ago
source link: https://github.com/osquery/osquery/pull/6984
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Closes #6979 fixing a small regression introduced in #6782 that undid part of #6714

It's easy to forget to free memory with "Caller must free this parameter" APIs like ConvertStringSidToSidA, fixed before in #6714 (we even forgot to do it in the wrapper we created for ConvertSidToSidStringA, see #6548 that fixed that).

Because a wrapper for ConvertSidToSidStringA, I found one place that I changed to use that, instead of the raw API, saving a few lines of code. But in the future, to avoid similar problems with ConvertStringSidToSidA, we'd have to make our own wrapper class for sid that implemented RAII as noted by @Breakwell.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK