Skip to content

Commit

Permalink
Merge pull request #1373 from stilettk/static-analysis-fixes
Browse files Browse the repository at this point in the history
Fixed issues found by PVS-Studio.
  • Loading branch information
bgrainger authored Sep 18, 2023
2 parents 59bb840 + 3b99ed2 commit 5ce15fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MySqlConnector/Core/ServerSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ private async Task InitSslAsync(ProtocolCapabilities serverCapabilities, Connect
try
{
var storeLocation = (cs.CertificateStoreLocation == MySqlCertificateStoreLocation.CurrentUser) ? StoreLocation.CurrentUser : StoreLocation.LocalMachine;
var store = new X509Store(StoreName.My, storeLocation);
using var store = new X509Store(StoreName.My, storeLocation);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

if (cs.CertificateThumbprint.Length == 0)
Expand Down Expand Up @@ -1743,7 +1743,7 @@ private void VerifyState(State state1, State state2, State state3, State state4,
{
if (m_state != state1 && m_state != state2 && m_state != state3 && m_state != state4 && m_state != state5 && m_state != state6)
{
ExpectedSessionState6(m_logger, Id, state1, state2, state3, state4, state5, state5, m_state);
ExpectedSessionState6(m_logger, Id, state1, state2, state3, state4, state5, state6, m_state);
throw new InvalidOperationException($"Expected state to be ({state1}|{state2}|{state3}|{state4}|{state5}|{state6}) but was {m_state}.");
}
}
Expand Down

0 comments on commit 5ce15fb

Please sign in to comment.