mirror of
https://github.com/BeneficialCode/WinArk.git
synced 2026-10-17 04:40:35 +08:00
fixup memory leak
This commit is contained in:
+6
-2
@@ -28,8 +28,12 @@ bool Sid::IsValid()const {
|
||||
|
||||
std::wstring Sid::AsString() const {
|
||||
PWSTR str;
|
||||
if (::ConvertSidToStringSid((PSID)*this,&str))
|
||||
return str;
|
||||
std::wstring result;
|
||||
if (::ConvertSidToStringSid((PSID)*this, &str)) {
|
||||
result = str;
|
||||
::LocalFree(str);
|
||||
return result;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user