diff --git a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs index 3e6bbcafd10..c6969c79c07 100644 --- a/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs +++ b/src/Microsoft.PowerShell.LocalAccounts/LocalAccounts/Sam.cs @@ -1273,7 +1273,7 @@ private LocalUser CreateUser(LocalUser userInfo, System.Security.SecureString pa } catch (Exception) { - if (IntPtr.Zero != userHandle) + if (userHandle != IntPtr.Zero) { SamApi.SamDeleteUser(userHandle); } @@ -2369,7 +2369,7 @@ private RawAcl GetSamDacl(IntPtr objectHandle) } finally { - if (IntPtr.Zero != securityObject) + if (securityObject != IntPtr.Zero) status = SamApi.SamFreeMemory(securityObject); } @@ -2662,7 +2662,7 @@ private SecurityIdentifier RidToSid(IntPtr domainHandle, uint rid) } finally { - if (IntPtr.Zero != sidBytes) + if (sidBytes != IntPtr.Zero) status = SamApi.SamFreeMemory(sidBytes); }